Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

INTRODUCTION TO JAVASCRIPT

Rating
-
Sold
-
Pages
3
Uploaded on
16-06-2025
Written in
2018/2019

Introduction to JavaScript Reference Types in JavaScript In JavaScript, we have two types of data types: Primitive Types: These include string, number, boolean, null, undefined, and symbol. Reference Types: These include objects and arrays. Objects and Properties in JavaScript Objects are key-value pairs where the keys are strings and the values can be any data type. These keys are also known as properties. For example: let person = { name: 'John Doe', age: 30, isStudent: false }; In this example, name, age, and isStudent are properties of the person object. JavaScript Syntax and Basics JavaScript uses curly braces {} to define objects and blocks of code, and parentheses () for function calls and expressions. Semicolons ; are used to end a statement. Variables in JavaScript Variables are used to store data. In JavaScript, we use the let keyword to declare variables. For example: let message; message = 'Hello World'; (message); Constants in JavaScript Constants are variables that cannot be reassigned a new value. We use the const keyword to declare constants. For example: const MAX_VALUE = 100; MAX_VALUE = 200; // This line will throw an error JavaScript Data Types JavaScript has several data types, which include: String: A sequence of characters, enclosed in single or double quotes. Number: A numeric value, including integers and floating-point numbers. Boolean: A value that can be either true or false. Null: Represents the intentional absence of any object value. Undefined: Represents the value of a variable that has not been assigned a value. Symbol: An unique and immutable primitive value used as the key for object properties. Arrays and Array Literals in JavaScript Arrays are used to store multiple values in a single variable. We can declare an array using array literals. For example: let numbers = [1, 2, 3, 4, 5]; let names = ['John', 'Jane', 'Bob']; Functions and Function Calls in JavaScript Functions are reusable blocks of code that can be executed multiple times. We can declare a function using the function keyword and call it using its name. For example: function greet(name) { ('Hello, ' + name + '!'); } greet('John'); // Output: Hello, John! Parameters and Arguments in Functions Functions can accept parameters, which are variables used within the function. Arguments are the values passed to the function when it is called. For example: function add(num1, num2) { return num1 + num2; } let result = add(5, 10); (result); // Output: 15 In this example, num1 and num2 are parameters, and 5 and 10 are arguments. JavaScript Runtime Environments JavaScript code is executed in a runtime environment, which provides the necessary services for the code to run, such as memory management and I/O operations. Examples of runtime environments include web browsers and N. Setting up a Development Environment To start developing in JavaScript, we need to set up a development environment. This involves installing a code editor, such as Vi

Show more Read less
Institution
Course

Content preview

Introduction to JavaScript Reference
Types in JavaScript
In JavaScript, we have two types of data types:

1. Primitive Types: These include string, number, boolean, null, undefined, and
symbol.
2. Reference Types: These include objects and arrays.

Objects and Properties in JavaScript
Objects are key-value pairs where the keys are strings and the values can be any
data type. These keys are also known as properties. For example:

let person = {

name: 'John Doe',

age: 30,

isStudent: false

};

In this example, name, age, and isStudent are properties of the person object.

JavaScript Syntax and Basics
JavaScript uses curly braces {} to define objects and blocks of code, and
parentheses () for function calls and expressions. Semicolons ; are used to end a
statement.

Variables in JavaScript
Variables are used to store data. In JavaScript, we use the let keyword to declare
variables. For example:

let message;

message = 'Hello World';

console.log(message);

Constants in JavaScript
Constants are variables that cannot be reassigned a new value. We use
the const keyword to declare constants. For example:

Written for

Institution
Course

Document information

Uploaded on
June 16, 2025
Number of pages
3
Written in
2018/2019
Type
Class notes
Professor(s)
N/a
Contains
All classes

Subjects

$300.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
srinithikamalakannan

Get to know the seller

Seller avatar
srinithikamalakannan
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
11 months
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions