DEV Community

Arul perumal
Arul perumal

Posted on

Java Script

Hi everyone, today I learned about the introduction to JavaScript and its types. I'm sharing it here with you all."

What is javaScript
Java script is a scripting language used to create and control the daynamic website content
What is data Type **
In programming language data typeI define the kind of a data a variable can store
they are two catagory
(1)Primitive data type
(2) Non- Primitive type
primitive data types

a) String
b)Number
C) Boolean
d) bigint
e) symbol
f) Undefined
g) Null
non primitive data
a)Object
**String

String data type is group ofcharacter or textual Content
Ex:Var str="Hello World"
Number
Number data type is a number value it can be integer (positive or negative), floating point or exponential
Ex:Var a=47
Var b=62.9
Var c=5
The number data types also includes special values such as infinity -infinity and NAN
infinity when positive number divided by zero the result is infinite
when negative number divided by zero the result is -infinity
NAN -Not An Number
Boolean
blooean Data type is used to compare two variables or check a condition.it has only two values namely true or false
Ex.Var a=10
Var b=9
a==b//Return false
undefined
Null Value means No value.it's means empty value or absence of value
Ex.Var X= null
Console log(x)// returned null
symbol
The symbol data type in javascript define a property of an object which is private to the object.the value with symbol data type can be referred to as a symbol value.the symbol value refers to key of the key value pair of an object every symbol is unique.two symbol with same key value are not the same
Ex.let value 1= symbol ("value")
let value 2= symbol(" value")
alert (Value1= value 2):// false
in the above example both value 1 and value 2 contain the same key value but they are different as they are of the symbol type
bigint
Large number
ex:123456789
Objects
An object is like a container that stores state and behaviorus
we can say in simple words
it's is the collection of properties(attributes)and methods(Actions ) it contains

it contains key value pairs in its address the property of the objects are written as key value pairs each pairs is seperated by commas ,enclosed in curly basis {} the key must be a String and value can be of any data type
ex: Var students={First Name:'jhon', Class 7}
Compiler and interpreter

A compiler translate the whole program at once , which can make it run faster but takes more time to compile
an interpreter translate and run the code line by line making it easier to catch errors and debug thought it may run slower.

**programming type

Statically type -Data types are fixed.
dynamically type -Data type can change during run time

Internal and external java script
internal java script
written directly inside the HTML file using the script tag..

*external java script *
external javascript refers to writing your javascript code in a seperate file with a js extension

Top comments (0)