0% found this document useful (0 votes)
10 views4 pages

JAVA Script

The document provides an overview of JavaScript fundamentals, including data types, variable declaration, and type conversion. It discusses how to use comparison operators and control structures like if-else statements to manage user roles and conditions. Additionally, it includes examples of converting various data types and executing JavaScript code in a terminal.

Uploaded by

alemakef shumiye
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views4 pages

JAVA Script

The document provides an overview of JavaScript fundamentals, including data types, variable declaration, and type conversion. It discusses how to use comparison operators and control structures like if-else statements to manage user roles and conditions. Additionally, it includes examples of converting various data types and executing JavaScript code in a terminal.

Uploaded by

alemakef shumiye
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 4

1 JAVA Script

 Data type (int, float, string,


boolean, char,)
 E.g “Dave”
 about:blank  typteof” ” (to print entered
data type)
 Used open codeing page on tochrome brouser  typteof 42, typeof 4.2,
typeof true,
• Sitting->them->dark (to change back color)
• Console (to type codes)
 Declaring variables (var, let, const, nothing)  Node index.js (to excute js on terminal window)
In js, a variable can store any type of data
since js understand it. Int & number are
same. Infinity is treated as a number.

Ex. Identify data type of the f.f


A range that a single var/let can store

Ex. Convert “123Tap”, “ 123Tap”, “ 1 2 3”, “Tp123”, “ “


“academy”, into a number & Boolean.
Ex. Compare 5 and ‘5’.
Convert number & Boolean into string.
Boolean to number, string to Boolean

Number

String

Boolean
Ex. Convert “123Tap”, “ 123Tap”, “ 1 2 3”, “Tp123”, into a
number & boolean
Comparison operator Ex. If age is >18, you well come.
Ex. If cartTotal is >=12000 please show that he is qualified for free
shipping.
Ex. Show transaction successful and insufficient balance.
Ex. Make a program that show us the remaining balance after the
transaction is conducted.
If statement and switch
UserRole:
If-else in js Admin:Grant full access to the system
Athore: permit creation of content
Editor: allow editing of content
Subscriber: enable content viewing

You might also like