Showing posts with label javascript_statement. Show all posts
Showing posts with label javascript_statement. Show all posts

Wednesday, October 1, 2008

for … in Statement

ဒီ for.. in ကို javascript array ရဲ ့ element တစ္ခုခ်င္းစီကို ပတ္ခ်င္တဲ့ အခါမွာ သံုးပါတယ္။

ဥပမာ

<html>
<body>
<script type="text/javascript">

var x;
var mygreeting= new Array();

mygreeting[0] = "Hello";
mygreeting[1] = "World";
mygreeting[2] = "Greeting by Akela.";

for (x in mygreeting)
{
alert(mygreeting[x]);
}

</script>
</body>
</html>

အထက္ပါ ကုဒ္ေလးကို ခ်ခိုင္းတဲ့ အခါ ေအာက္ပါပံုအတိုင္း ၿမင္ရပါလိမ့္မယ္။




အာေကလာ

၂၇ စက္တင္ဘာ ၂၀၀၇