What is
JavaScript
JS is a programming language. We use it to give instructions to
the computer.
Input Comput Output
(code) er
Setting up VS code
It is a free & popular code editor by
Microsoft
Our 1st JS Code
Console.log is used to log (print) a message to
the console
console.log(“BCA ”);
Variables in JS
Variables are containers for
data
radiu
s
14
memory
Variable
Rules
Variable names are case sensitive; “a” & “A” is different.
Only letters, digits, underscore( _ ) and 3 is allowed. (not
even space) Only a letter, underscore( _ ) or 3 should be
1st character.
Reserved words cannot be variable names.
let, const &
var
var : Variable can be re-declared & updated. A global scope
variable.
let : Variable cannot be re-declared but can be updated. A block
scope variable. const : Variable cannot be re-declared or updated.
A block scope variable.
Data Types in JS
Primitive Types : Number, String, Boolean, Undefined, Null,
BigInt, Symbol
Let‘s Practice
Qs1. Create a const object called “product” to store information shown
in the picture.
Let‘s Practice
Qs2. Create a const object called “profile” to store information shown
in the picture.