Friday, March 25, 2011

Suratku Untukmu ( Queue Unshift & Shift )

<html> <head> <title>Program Queue dengan Shift dan Unshift</title> <script language="javascript"> <!-- function DataQueue() { var queue = []; queue.unshift(1); queue.unshift(2); var i = queue.shift(); document.write(i + "<br>"); queue.unshift("pertama"); queue.unshift("kedua"); var i = queue.shift(); document.write(i + "<br>"); document.write(queue[0]); } //--> </script> </head> <body> <form name = "FormStrukturData"> <input name = "btnQueue" value = "Queue" type = "button" onClick="DataQueue();" /> </form> </body> </html>

0 komentar:

Post a Comment

Tinggalkan Komentar Disini