Javascript String isNumeric()
String.prototype.isNumeric = function() { return !isNaN(this); }; String.prototype.capitalise = function() { return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase(); };
String.prototype.isNumeric = function() { return !isNaN(parseFloat(this)) && isFinite(this); };
// extend the string prototype object to abstract generic functionality String.prototype.isNumeric = function(){ return !isNaN(parseFloat(this)) && isFinite(this); }
var postfixStack = new Array String.prototype.isNumeric = function() { return !isNaN(parseFloat(this)) && isFinite(this); } function MathSolver() { this.infixToPostfix = function(infix) { //from www.j a v a2 s .co m for(var i = 0; i < infix.length; i++) { var token = infix[i]; if(token.isNumeric()) { postfixStack.push(Number(token)); //SMM } } } this.printStack = function() { return postfixStack; } } console.log(postfixStack)