Numbers
Get hands-on experience on how to use numbers as a JavaScript data type.
Context: JavaScript data types
When it comes to programming, pretty much everything we do revolves around storing and manipulating data. This data always has a type associated with it that tells the computer exactly how to handle the data that it’s given. In JavaScript, the data’s type is automatically determined when the code is executed.
What exactly do we mean by this? Let’s take a look at an example.
Press + to interact
var number1 = 10;var number2 = 20;console.log(number1 + number2);
1.
Pause and think: What do you expect this code to do?
Show Answer
Q1 / Q1
Did you find this helpful?
For your reference,
console.log()
outputs to the console ...