Sunday, May 23, 2010
Queue Unshift & Shift
Posted by Dendi Prana Yudha in
Kuliah,
Web
<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