What is JavaScript?
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
Apna College
JS is a programming language. We use it to give instructions to the computer.
Output
Input (code) Computer
Setting up VS Code
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
It is a free & popular code editor by Microsoft
Apna College
Our 1st JS Code
Apna College
console.log(“Apna College”);
Console.log is used to log (print) a message to the console
Variables in JS
Variables are containers for data
memory
radius
14
Apna College
Variable Rules
Apna College
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
Apna College
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
Apna College
Number
Follow
String
Boolean
Apna College
Let‘s Practice
Qs1. Create a const object called “product” to store information shown in the picture.
Apna College
Let‘s Practice
Qs2. Create a const object called “profile” to store information shown in the picture.
Apna College

JavaScript1 Notes for beginners Notes.pdf

  • 1.
    What is JavaScript? useconsole 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 Apna College JS is a programming language. We use it to give instructions to the computer. Output Input (code) Computer
  • 2.
    Setting up VSCode 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 It is a free & popular code editor by Microsoft Apna College
  • 3.
    Our 1st JSCode Apna College console.log(“Apna College”); Console.log is used to log (print) a message to the console
  • 4.
    Variables in JS Variablesare containers for data memory radius 14 Apna College
  • 5.
    Variable Rules Apna College Variablenames 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.
  • 6.
    let, const &var Apna College 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.
  • 7.
    Data Types inJS Primitive Types : Number, String, Boolean, Undefined, Null, BigInt, Symbol Apna College
  • 8.
  • 9.
    Let‘s Practice Qs1. Createa const object called “product” to store information shown in the picture. Apna College
  • 10.
    Let‘s Practice Qs2. Createa const object called “profile” to store information shown in the picture. Apna College