Примитив Для меня означает Базовый ! Как Пещерт … И вы буквально не можете строить что -либо без основных данных. Примитивный тип данных – это данные, которые не являются объект и нет Методы Анкет
- Числа
- НИТЬ
- Логический
- НЕОПРЕДЕЛЕННЫЙ
- NULL
Примеры номеров JavaScript
100 //Integers 50 1.1 //Floats 100.69
Примеры строк JavaScript
"Hi!" //you can define a 'string' by double quotes. 'Hi!' //you can also define a 'string' by single quotes. "30" // this is also a string
Примеры логических JavaScript
true // Booleans only state is 'true' or 'false false // It is either on or off, yes or no!!
Примеры JavaScript Null & Undefined
// null means that there is no value assigned..empty // and is intentionally set // undefined means that the container exists // but hasnt been given a value console.log(null === undefined); //false console.log(null == undefined); // true
Еще один день жизни с использованием примитивных типов данных в цикле
//while some number is less than 10, console.log('string type')
let i = 1;
// while something is true..run this scoped code
while (i < 10) {
console.log('string type', i)
i += 1 // i = i + 1
}
Оригинал: “https://dev.to/xxbricksquadxx/what-are-some-of-js-primitive-data-types-2k90”