Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How to make a array as a stack using JavaScript?
How to make a array as a stack using JavaScript?
✍: Guest
The pop() and push() functions turn a harmless array into a stack:
<script type="text/javascript">
var numbers = ["one", "two", "three", "four"];
numbers.push("five");
numbers.push("six");
document.write(numbers.pop());
document.write(numbers.pop());
document.write(numbers.pop());
</script>
This produces:
sixfivefour
2011-07-26, 4234👍, 0💬
Popular Posts:
How Many Tags Are Defined in HTML 4.01? There are 77 tags defined in HTML 4.01: a abbr acronym addre...
What is COCOMO I, COCOMOII and COCOMOIII? In CD we have a complete free PDF tutorial of how to prepa...
What Is the Text Paragraph Formatting Model? - CSS Tutorials - HTML Formatting Model: Block, Inline ...
What is shadowing ? When two elements in a program have same name, one of them can hide and shadow t...
The object that contains all the properties and methods for every ASP.NET page, that is built is .. ...