Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
5 views

JS1 ClassNotes

JavaScript (JS) is a programming language used to instruct computers, with initial coding often done in browser consoles before transitioning to files. Variables in JS serve as data containers, with specific rules for naming and three types of variable declarations: var, let, and const. The document also introduces data types in JS and includes practice exercises for creating objects.

Uploaded by

ffg290824
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

JS1 ClassNotes

JavaScript (JS) is a programming language used to instruct computers, with initial coding often done in browser consoles before transitioning to files. Variables in JS serve as data containers, with specific rules for naming and three types of variable declarations: var, let, and const. The document also introduces data types in JS and includes practice exercises for creating objects.

Uploaded by

ffg290824
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

What is JavaScript?

JS is a programming language. We use it to give instructions to the computer.

lege
Col
a
Input (code) Computer Output

Apn
use console in any browser or just open one of your projects and use that

the code is not permanent, we can use the up & down arrow to bring back old code
Setting up VS Code
It is a free & popular code editor by Microsoft

lege
Col
pna
A we'll use the chrome developer tools console to write our code
but not for long terms as afterwards we will start to use js file
like we used for css
Our 1st JS Code
Console.log is used to log (print) a message to the console

lege
Col
console.log(“Apna College”);

pna
A
Variables in JS
Variables are containers for data

lege
Col
na
radius

14
Ap
memory
Variable Rules
Variable names are case sensitive; “a” & “A” is different.

lege
l
Only letters, digits, underscore( _ ) and $ is allowed. (not even space)

a Co
Only a letter, underscore( _ ) or $ should be 1st character.

Apn
Reserved words cannot be variable names.
let, const & var
var : Variable can be re-declared & updated. A global scope variable.

lege
ol
let : Variable cannot be re-declared but can be updated. A block scope variable.

C
pna
A
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

lege
Col
pna
A
ge
String

ol le
a C
Number

Follow
Apn
Boolean
Let‘s Practice
Qs1. Create a const object called “product” to store information shown in the picture.

lege
Col
pna
A
Let‘s Practice
Qs2. Create a const object called “profile” to store information shown in the picture.

lege
Col
pna
A

You might also like