Created
September 26, 2013 09:04
-
-
Save webdevotion/6711678 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var line = " - - - - - - - - - - - - - - - - - "; | |
function log( message ) | |
{ | |
console.log(message); | |
} | |
function title( message ) | |
{ | |
log("\n"); | |
log( line ); | |
log( "| " + message ); | |
log( line ); | |
} | |
var rgb = []; | |
rgb.push("red"); | |
rgb.push("green"); | |
rgb.push("blue"); | |
log(rgb); | |
var colors = ["orange", "yellow", "pink", "purple"]; | |
log(colors); | |
var cssColors = new Array("#FF0000", "#00FF00" ); | |
log(cssColors); | |
// arrays zijn zero-indexed! | |
var red = rgb[0]; | |
// de lengte van een array | |
var numberOfColorsInRGB = rgb.length; | |
log( "Er zijn " + numberOfColorsInRGB + " kleuren in RGB" ); | |
var purple = colors.pop(); | |
log( "Zonder purple: " + colors ); | |
title( "RGB KLEURENSPECTRUM" ); | |
for( var i = 0; i < rgb.length; i++ ) | |
{ | |
log( rgb[i] ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment