My code looks like:
<body>
<script type="text/javascript">
var coin=newArray();
coin[0]="heads";
coin[1]="tails";
document.write(coin[math.round(math.random)]);
</script>
</body>
Nothing shows up.
There's 3 errors in your code above:
- math need to have a capital M (Math)
- newArray() is two words (new Array())
- You randomiser will give you the numbers 0 to 2 inclusive where 1 is picked 50% of the times and 0 and 2 25% each.
math needs to be capitalized.
Life's too short to be cool. Be a nerd.
Thanks! It works now.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks