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, 3980👍, 0💬
Popular Posts:
How to convert a Unix timestamp to a Win32 FILETIME or SYSTEMTIME? The following function converts a...
What print out will the folloging code produce? main() { char *p1=“name”; char *p2; p2=(char*)malloc...
How do you locate the first X in a string txt? A) txt.find('X'); B) txt.locate('X'); C) txt.indexOf(...
How did you implement UML in your project ? PART II Implementation phase / Coding phase (Class diagr...
How many types of validation controls are provided by ASP.NET ? There are six main types of validati...