Link Search Menu Expand Document

Understanding Uninitialized Variables

Summary

  • JavaScript variables are declared with an initial value of undefined.
  • If you do a mathematical operation on an undefined variable your result will be NaN meaning Not A Number.

Final Code

// Only change code below this line
var a = 5;
var b = 10;
var c = "I am a";
// Only change code above this line

a = a + 1;
b = b + 5;
c = c + " String!";