Introduction to JavaScript: Variables, Data Types, and Console Logging, Study notes of Computer science

A basic introduction to javascript, covering fundamental concepts such as variables, data types, and the use of the console for output. It also includes practical exercises to reinforce learning. Suitable for beginners learning javascript and provides a solid foundation for further exploration.

Typology: Study notes

2024/2025

Available from 04/13/2025

aaditya-singh-bhadoriya
aaditya-singh-bhadoriya 🇮🇳

2 documents

1 / 10

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Introduction to JavaScript: Variables, Data Types, and Console Logging and more Study notes Computer science in PDF only on Docsity!

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

Variables in JS

Variables are containers for data

memory

radius

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.

Data Types in JS

Primitive Types : Number, String, Boolean, Undefined, Null, BigInt, Symbol

Apna College

Number

Follow

String

Boolean

Apna Col

lege

Let‘s Practice

Qs2. Create a const object called “profile” to store information shown in the picture.

Apna College