You are on page 1of 11

JavaScript

Data Types
Eight Data Types
Seven primitive data types
• number for numbers of any kind: integer or float
• bigint for an integer number of arbitrary length
• string for string: string may have zero or more characters
• boolean for true/false
• null for unknown values: has a single value null
• undefined for unassigned values: has a single value undefined
• symbol for unique identifiers
One non-primitive data type:
• object for more complex data structure

01/07/2023 PRESENTATION TITLE 2


3 browser-specific functions in js
Interaction: alert, prompt, confirm

alert: it shows a message

for example: alert(“Hello”);

prompt: the function “prompt ” accepts two arguments

syntax: result = prompt(title,[default]);

confirm: result = confirm(“question”);

Let isBoss = confirm(“Are you the boss?”);

alert(isBoss);

01/07/2023 PRESENTATION TITLE 3


Type Conversion
Type conversion is used to convert one
data type into another. there are a few
types of type conversion are given below.
String conversion
Boolean conversion
Numeric conversion
Type Conversion
let str = “123”;
alert(typeof str); // string

let num = Number(str); / / become a number 123


alert(typeof num); / / number

01/07/2023 PRESENTATION TITLE 5


Basic operators, maths
Math operations
• Addition +,
• Subtraction -,
• Multiplication *,
• Division /,
• Remainder %,
• Exponentiation **

01/07/2023 PRESENTATION TITLE 6


Comparisons Operators
• >
• <
• >=
• <=
• !=
• ==
all comparisons operators return a boolean value for example
alert( 2>1 ); / / return true ( correct )
alert( 2 == 1 ); / / return false ( wrong )

01/07/2023 PRESENTATION TITLE 7


Reference Type
• Object
• Arrays
• functions / / dot notation
person.name = ‘sunaina’;
Object:
/ / bracket notation
let person = {
let selection = ‘name’;
name :“sunaina”;
person[‘name’] = ‘samuel’;
age:25;
} / / object literal

01/07/2023 PRESENTATION TITLE 8


How we get there
ROI Niche Markets Supply chains
Envision multimedia-based Pursue scalable customer Cultivate one-to-one
expertise and cross-media service through sustainable customer service with robust
growth strategies strategies ideas
Visualize quality intellectual Engage top-line web Maximize timely
capital services with cutting-edge deliverables for real-time
Engage worldwide deliverables schemas
methodologies with web-
enabled technologies

01/07/2023 PRESENTATION TITLE 9


Summary

At Contoso, we believe in giving 110%. By using our next-generation data


architecture, we help organizations virtually manage agile workflows. We
thrive because of our market knowledge and great team behind our product.
As our CEO says, "Efficiencies will come from proactively transforming how
we do business."

01/07/2023 PRESENTATION TITLE 10


Thank you
Mirjam Nilsson​
mirjam@contoso.com
www.contoso.com

You might also like