Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
December 20, 2021 09:05 am GMT

Day 96/100 Data Types

banner

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 or false (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 than null.
  • 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.

resource


Original Link: https://dev.to/riocantre/day-96100-data-types-52m7

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To