Skip to content

Instantly share code, notes, and snippets.

@katherineschultz
Created October 14, 2014 01:00
Show Gist options
  • Save katherineschultz/43f41c690b926ffc4c84 to your computer and use it in GitHub Desktop.
Save katherineschultz/43f41c690b926ffc4c84 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script>
var x = 0;
while (x < 5) {
console.log(x);
x++;
}
//for (var i=0; i<5; i++) {
// console.log(i);
//}
var rainbowColors = ["Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet" ];
console.log (rainbowColors.length);
alert (rainbowColors);
alert (rainbowColors[1]);
rainbowColors[0] = "kelly";
alert (rainbowColors[0]);
alert (rainbowColors);
rainbowColors.push("Tangerine");
alert (rainbowColors);
var rainbowColors = ['Red', 'Orange', 'Yellow', 'Green', 'Blue', 'Indigo', 'Violet'];
for (var i = 0; i < rainbowColors.length; i++) {
console.log(rainbowColors[i]);
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment