Quas : WHAT IS JAVASCRIPT PRIMITIVE AND NON PRIMITIVE DATA TYPE ?
Ans :
primitive =>
STRING => var myName = 'iqbal';
NUMBER => var myAge = 25;
BOOLEAN => var iAmStudent = true;
symbol => +, -, *, /, % +=, -=, ++, --, <, >, =, ==, ===, !==, !=, <=, >=
undefined => A variable that has not been assigned a value of your code
null => Null means having no value
non-primitive =>
ARRAY =>
var friendsName = ['habib', 'iqbal', 'shorif', 'asraful', 'rasel', 'arif', 'deader' ];
OBJECT =>
var mobile = {
brand : 'iPhone',
price : 79000,
storage : '64gb',
camera : '50MP'
}
FUNCTION =>
function isEven(number){
const remainder = number % 2;
if(remainder === 0){
return true;
}
else{
return false;
}
}
const evEnNumber = 180;
const evenNumber2 = 185;
const toTalEven = isEven(evEnNumber);
const totalEven2 = isEven(evenNumber2);
console.log(toTalEven);
console.log(totalEven2);