Some info about Coding
Data Types in Javascript
The data type is a basic type of data that can be used in a program language. Javascript have 2 types of data type. Primitive Data Type and Non-Primitive Data Type. Primitive Data Type have 5 types of data. And Non-Premitive Data Type have only 3 types of data. Let’s see an Example.
Number
Number in Javascript represent the numeric value in Integer and Decimal. Let’s see an Example.
String
String in Javascript show us any sentences/character. If you want to use String you must be give the sentences or word into a quotations. If you use string outside a quotation, Javascript will throw an error. Let’s see an Example.
Boolean
Boolean in Javascript is used for Conditional testing. Boolean only have two values. True or False. Let’s see an Example.
Undefined
Undefined in Javascript is used for knowing that the value of its is not defined. Let’s check an Example. Now there is the value is undefined, But when you will use it, if there will no value defined it will say undefined.
Null
Null in Javascript is used for knowing intentional absence of any object value. Let’s check an Example. Now there is the value is null, But when you will use it, if it don’t find any value, It will say null.
Object
Object in Javascript is a Non-Primitive Data Type value. Object is a collection of Properties and its Value. If you declare any Property and Value into any {} bracket, it will be an object. Let’s see an Example to clear the problem.
Array
Array in Javascript is a Non-Primitive Data Type value. Array is a single variable that is used for store multiple elements or multiple object in it. If you declare any multiple elements inside a [] bracket, it will be an array. Let’s see an Example to clear it.
Function
Function is Javascript is a Non-Primitive Data Type value. JavaScript functions are used to perform any special operations. We can call JavaScript function many times to reuse the code at anywhere you want. Let’s see a quick Example.
Comments
Comments are very important in any programming language or developing language. Comments are used for explain coding information to other person. Let’s see some comments type.
1. Javascript Comment
In Javascript, comments are declared from //. if any line start from // the line will be commented.
2. HTML Comment
In HTML, comments are declared like shown in the bellow image.
3. CSS Comment
In CSS, Comments are start from /* and end with */. The middle text will be commented.