I\'m looking for a way to read the most recent command that was logged to the firebug console.
For example, I could have something that does
console.
You might wanna implement a queue. Expanding on Devin's answer: (something like this)
var window.log = [];
logger function(msg) {
var log_length = 10;
console.log(msg);
window.log.push(msg);
if(window.log.length > log_length) {
window.log.shift()
}
}
See:
How do you implement a Stack and a Queue in JavaScript?
http://aymanh.com/9-javascript-tips-you-may-not-know#string-concatenation-vs-arrayjoin