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, 3979👍, 0💬
Popular Posts:
How To Manage Transaction Isolation Level? - Oracle DBA FAQ - Introduction to PL/SQL Transaction iso...
What are the different storage classes in C? C has three types of storage: automatic, static and all...
How To Join a List of Keys with a List of Values into an Array? - PHP Script Tips - PHP Built-in Fun...
In which event are the controls fully loaded ? Page_load event guarantees that all controls are full...
If cookies are not enabled at browser end does form Authentication work? No, it does not work.