Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

‭JavaScript allows you to create dynamic effects and web applications in the web browser.

‭ S stands for ECMAScript‬


E
‭ES6/ES2015 was the biggest update to the programme language ever. (ES6 onwards is modern‬
‭programming language)‬

‭Values and Variables‬

‭Value‬‭- this is the smallest unit of information that‬‭can be shown in javascript‬

‭ alue can be show as;‬


V
‭“Jonas”‬
‭To show on console type‬‭console.‬‭log‬‭before the value‬
‭console.log(“Jonas”);‬
‭How to assign a variable to a value:‬
‭Let firstName = “Jonas”;‬
‭#Variable === firstName‬

‭Conventions and Rules for naming Variables:‬

‭ .‬ A
1 ‭ variable name cannot start with a number. As this would cause a‬‭SyntaxError.‬
‭2.‬ ‭You cannot use a reserved keyword (ie. new) as a name for your variable.‬
‭3.‬ ‭As a convention you should not start your variable with a capital letter as that is mainly‬
‭used in object-oriented programming.‬

‭ bjects or Primitives‬
O
‭Value can be shown as either object(“Jonas”;) or primitives(36;)‬

‭The 7 primitive data types:‬

‭ .‬ N
1 ‭ umber‬‭-‬‭Floating point numbers- Used for decimals‬‭and integers (ie. let age = 23;)‬
‭2.‬ ‭String‬‭-‬‭Sequence of characters- Used for text (ie.‬‭let firstName = “Jonas”;)‬
‭3.‬ ‭Boolean‬-‭ ‬‭Logical type that can only be‬‭true‬‭or‬‭false-‬‭Used for taking decisions (ie. let‬
‭fullAge = true;)‬

‭4.‬ U ‭ ndefined‬‭- Value taken by a variable that is not yet‬‭defined ‘Empty value’ (ie. let‬
‭children;)‬
‭5.‬ ‭Null‬‭- Also means ‘Empty value’‬
‭6.‬ ‭Symbol (ES2015)‬‭- Value that s unique and cannot be‬‭changed‬
‭7.‬ ‭Biglnt (ES2020)‬‭- Larger integers than number type‬‭can hold.‬

You might also like