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, 3921👍, 0💬
Popular Posts:
What is the main difference between a Vector and an ArrayList? Java Vector class is internally synch...
. How can a servlet refresh automatically if some new data has entered the database? You can use a c...
What Happens to Indexes If You Drop a Table? - Oracle DBA FAQ - Managing Oracle Table Indexes If you...
What is the difference between "printf(...)" and "sprintf(...)"? sprintf(...) writes data to the cha...
How Large Can a Single Cookie Be? - PHP Script Tips - Understanding and Managing Cookies How large c...