<html>
<head>
<title>Program Queue dengan pop dan unshift JavaScript</title>
<script language="JavaScript">
function DataQueue()
{
var queue=[];
queue.unshift(1);
queue.unshift(2);
var i=queue.pop();
document.write(i+"<br/>");
queue.unshift(3);
queue.unshift(4);
var i=queue.pop();
document.write(i+"<br/>");
}
</script>
</head>
<body>
<form name="FormStrukturData">
<input name="btnQueue" value="Queue" type="button" onClick="DataQueue();"/>
</form>
</body>
</html>
Queue_1
Label:
Queue_1
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar