Console Log

  • A method of debugging and troubleshooting in Javascript

  • Gives you the opportunity to print values to the log

  • Can be used as a means of confirming your code is “on the right track”

  • To print something to the console in Javascript, you use the console.log() method

// in your javascript file

// print out a name to the console
console.log("Kareem");


// print out values sentences with values (for more context)
// this uses string concatenation - we'll go over that shortly

// declare a variable called score and give it a value of 8
var score = 8;

// print out the variable in a sentence
console.log("your score is " + score);

JS Bin on jsbin.com