0% found this document useful (0 votes)
7 views

JS1 ClassNotes

JavaScript (JS) is a programming language used to instruct computers, with tools like the console for testing code. It involves concepts such as variables, which are containers for data, and different variable types (var, let, const) that dictate their mutability and scope. The document also covers data types in JS and includes practice questions for creating objects.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

JS1 ClassNotes

JavaScript (JS) is a programming language used to instruct computers, with tools like the console for testing code. It involves concepts such as variables, which are containers for data, and different variable types (var, let, const) that dictate their mutability and scope. The document also covers data types in JS and includes practice questions for creating objects.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
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.

Input (code) Computer Output

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

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

console.log(“Apna College”);
Variables in JS
Variables are containers for data

radius

14

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

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

Only a letter, underscore( _ ) or $ 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
String

Number

Follow

Boolean
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.

You might also like