String
-String is a plain text in javaScript and you can write it like this:
const singleQuoteMarks = 'Hi I am a single quote marks string';
const doubleQuoteMarks = "Hi I am a double quote marks string";
const templateLiterals = `Hi I am a template literals string`;
const withApostrophesTemplateLiterals = `I'm a string with apostrophes`
const withApostrophesSingolOrDoubleQuoteMarks = 'I/'m a string with apostrophes';
Number
-Number in JavaScript can be like a string or normal math number:
const stringNumber = '1';
const stringNumberOne = "2";
const sumStringNumber = stringNumber + streingaNumberOne; // '12' result
const number = 1;
const numberOne = 2;
const sum = number + numberOne // 3 result
const sumMath = 2 + 2; // 4 result
const substraction = 10 - 3 // 7 result
const multiplying = 6 * 6 // 36 result
const dividing = 36 / 6 // 6 result
const remainder = 115 % 10 // 5 result
Boolean
-Boolean is like a child the world is black or white on or off:
const married = true; // Is important not use quote marks!!
const rich = false; // Quote marks trasform boolean into string
Top comments (0)