An Interest In:
Web News this Week
- March 21, 2024
- March 20, 2024
- March 19, 2024
- March 18, 2024
- March 17, 2024
- March 16, 2024
- March 15, 2024
December 20, 2021 09:05 am GMT
Original Link: https://dev.to/riocantre/day-96100-data-types-52m7
Day 96/100 Data Types
Seven fundamental data types:
- Number: Any number, including numbers with decimals:
4
,8
,1516
,23.42
. - String: Any grouping of characters on your keyboard (letters, numbers, spaces, symbols, etc.) surrounded by single quotes:
' ... '
or double quotes" ... "
. Though we prefer single quotes. Some people like to think of string as a fancy word for text. - Boolean: This data type only has two possible values either
true
orfalse
(without quotes). Its helpful to think of booleans as on and off switches or as the answers to a yes or no question. - Null: This data type represents the intentional absence of a value, and is represented by the keyword
null
(without quotes). - Undefined: This data type is denoted by the keyword
undefined
(without quotes). It also represents the absence of a value though it has a different use thannull
. - Symbol: A newer featureto the language, symbols are unique identifiers, useful in more complexcoding. No need to worry about these for now.
- Object: Collections of related data.
Code Snippets
var prices = [1.23, 48.11, 90.11, 8.50, 9.99, 1.00, 1.10, 67.00];prices[0] = 2.33;prices[2] = 99.00;prices[6] = 3.00;for (var index = 0; index<prices.length; index++){ if(index===0){ prices[index]=11; } else if(index===2){ prices[index]=33; } else if(index===6){ prices[index]=77; }}console.log(prices);
Summary
Yesterday was the 2nd "Surprise" Drill in Technical line. Luckily, the electricity came back later the day and same time got extensions to pay the bills. I'm so coward that I could not afford to pay the bills on time, now I must submit my small useful blog on the same posting time.
Original Link: https://dev.to/riocantre/day-96100-data-types-52m7
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To