Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Variable

Which of the following variable names are valid?

  1. 1n
  2. ~n
  3. this_is_a_number
  4. n1?
  5. A1
  6. match
  7. function()

Exercise

  1. Create a val called pi and assign it the value of 3.14159:
  2. Create a val called message and assign it a string value:
  3. Create a val called age and assign it an integer value:
  4. Create a val called isTall and assign it a boolean value:
  5. Create a val called name and assign it a string value, then print a message that includes the value of name: