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 shift and unshift using JavaScript?
How to shift and unshift using JavaScript?
✍: Guest
<script type="text/javascript">
var numbers = ["one", "two", "three", "four"];
numbers.unshift("zero");
document.write(" "+numbers.shift());
document.write(" "+numbers.shift());
document.write(" "+numbers.shift());
</script>
This produces
zero one two
shift, unshift, push, and pop may be used on the same array. Queues are easily implemented using combinations.
2011-08-02, 4228👍, 0💬
Popular Posts:
What is Concern in AOP? gA concern is a particular goal, concept, or area of interesth There are m...
The following variable is available in file1.c, who can access it? static int average; Answer: all t...
Which one of the following statements is TRUE in regard to overloading the ++ operator? 1 You cannot...
Which bit wise operator is suitable for turning off a particular bit in a number? The bitwise AND op...
What is Shell scripting A shell script is a script written for the shell, or command line interprete...