Variables and Data Types in Java Script
In JavaScript, variables are used to store data values. There are three keywords used to declare variables in JavaScript: var, let, and const.
Here's an example of how to declare a variable using the var keyword:
javascript
var x = 5;
This creates a variable named x and assigns it the value of 5.
Data types in JavaScript include strings, numbers, booleans, null, undefined, and objects. Here's an example of how to declare a string variable:
javascript
var myName = "John";
No comments:
Post a Comment