I'm trying to make a terminal with jsQuery that has a log retrieval function.
I don't know how to
Here's my code:
RETRIEVE 1: function() {
this.echo('Log one.');
},
RETRIEVE 2: function() {
this.echo('Log two.);
}
As I understand what you need is object, key values pair:
I used object instead of array, because they don't need to be in order and some number may be missing.
var log = {
1: 'Log one.',
2: 'Log two.'
};
$('body').terminal({
RETRIEVE: function(logNumber) {
this.echo(log[logNumber]);
}
});