Skip to content

Instantly share code, notes, and snippets.

@webdevotion
Created September 26, 2013 09:04
Show Gist options
  • Save webdevotion/6711678 to your computer and use it in GitHub Desktop.
Save webdevotion/6711678 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
</body>
</html>
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