Data Types
Captain's Log, Stardate 48151.6
Today, we embark on a new mission to introduce young cadets to the fascinating world of JavaScript. Our lesson will focus on the essentials: variables, which allow us to store and manipulate information, and data types, specifically strings and numbers.
These building blocks will enable our cadets to perform mathematical operations and explore the intricacies of combining data types, such as the bizarre and unexpected outcome of adding
4
and"4"
... and getting"44"
. Fascinating.Our journey will also touch upon the use of code comments, a powerful tool in any aspiring programmer's arsenal. I am confident that our cadets will rise to the challenge and boldly go where no programmer has gone before.
End log.
PowerPoint Presentation
Code-Along: Math!
Let's explore the intricacies of combining data types! Click here to get started.
Advanced: Template Strings
Click here to learn all about this advanced technique for combining variables.