-
Comments
-
Strings
-
Basic math
-
Variable Data Type
-
Array
a. ArrayMethod b. Map()
-
Functions
-
Booleans and conditional statements
-
Switch Statements
-
Objects
-
Loop
-
Template Literal
-
Method
-
this keyword
-
object constructor function
-
For of and For in Loop
-
Break, Continue and Labels
-
Set
a. set.js b. set_method.js
-
TypeOf
-
Errors
-
Number
a. BigInt b. NumberMethod c. GlobalMethod d. NumberProperty
-
Math
-
Date
-
Class
a. class.js b. class_inheritence.js
This very small project is about types of comments and how to comment code in JavaScript.
This project contains all of the following aspects of string data type:
Syntax, escaping characters, escape sequences like ", ', \n, \t, \r, \b, concatenation, .length property, and immutability.
This projects includes all mathematical operations in JavaScript. Worked with
arithmethic and assignment opertaors. I also worked on math.random/generates
radnsom decimal and ParseInt/converts string to int functions.
This project allowed me to work on all the methods of variable declaration and values intialization.
var Is accessible anywhere in the code
let Is accessible within the scope declared
const Is used for values which are fixed and not muteable
In this project I have worked on arrays in JavaScript, syntax, modifying the elements
of arrays using the index, functions of arrays like:
ArrayMEthods
The array_methods.js file contains all array methods in JavaScript as follows:
toString() Returns an array as string with comma as seperator
length() Returns length of an array
pop() Deletes the last value
shift() Deletes the very first value
Unshift() Adds a value at the first with index 0
deletd() Remove a value from an array
slice() Slices part of an array/values into a new array
splice() Removes values without leaving holes/undefined in an array
flat() reduces the dimensionality/nested of nsested array
concat() concat method concatenates two arrays
In this little project, I have worked on functions in JavaScript, concatenation,
conditional statement of if and else if inside the function
and return statement with number and string data types whithin the functions.
I also worked on how a function returns a value and how a function acceps a single and
multiple values.
This project also includes function expression.
In this project, I have worked on followings:
a. booleans
b. conditional statement - if, else if, and else statements and chain of if, else if, and else statements
c. all comparison operators like: ==, ===, >, <, >=, <=, !=, !==,
d. logical operators: !, &&, and ||
This JavaScript project contains switch statement with default option, and multiple indetical options
used as cases to return the same value.
Inside this project, I have worked on how to create an object, nested objects, how to access to
properties inside the object and nested objects,
how to remove a property from an object, and how to add property and value using both
dot and bracket notations.
It also contans the JSON.stringify function.
In this .js file, I have worked on all three types of loops, for, while and do while loop.
It also includes anested loop.
This project actually allow me to know the basic and fundamental philosophy behind the Template literals.
In this project, I also worked on placing the variables inside the string using `backtick` characters.
In this project I have worked on the syntax for method within an object.
In this little project, I have worked on this keyword, its usage and its function with objects.
In this project, I have worked on how to create an object constructor function to use it as a blueprint
for other objects.
In this project, I have worked on "for of loop" and "for in loop" within array.
This project contains practical examples of break used within switches and loops. It also contains examples of
continue statements and JavaScript labels.
set.js
This set.js file contains JavaScript syntax for set and the basic undertading.
set_method.js
1. add() | Added the values using the variables
2. values() | Iterates the values in a set
3. size() | Returns the size of a set in number
4. delete() | Removes the vaues by passing the value itself, not the index
5. has() | Returns if the value exits or not with "true" and "false"
6. new Set() | creates a new set
7. size property | returns number of elements in a set
Typeof.js contains practical examples of all data types that can be hold in JavaScript Variables.
The erros.js file contains practical example of how to handle error with try, catch, throw, and finally code blocks.
I have also listed values(ErrorNames & Description) of JavaScript built in error object which are as follows:
1. SyntaxError
2. ReferenceError
3. TypeError
4. RangeError
5. URIError
This project has a few other files, each discuss an important concept in Number and BigInt Data types.
Number
This number.js contains practical examples of number data type in JavaScript.
BigInt
The bigint.js contains how to declare and assign a BigInt, the purpose and some other concepts as follows:
1. Number.MAX_SAFE_INTEGER | Return the maximum safe integer in JavaScript which is 9007199254740991
2. Number.MIN_SAFE_INTEGER | Returns the minimum safe integere in JavaScript which is -9007199254740991
3. Number.isInteger | Used to return true if a number/value is integer
4. Number.isSafeInteger | Returns true in a number is safe integer
NumberMethod
The number_method.js file contains the following number methods:
1. toString() | Returns a number as string
2. toExponential() | Returns a number written exponential notation
3. toFixed() | Return a number written with a number of decimal
4. toPrecision() | Returns a number with a specified length
5. ValueOf() | Returns a number as a number
GlobalMethod
The global_method.js contains global method in JavaScript as fllows:
1. parseInt | parses a string and returns a whole number
2. parseFloat | Parses a string and returns floating point number
3. Number | Returns a number and converted from its argument
NumberProperties
The number_properties is all about number properties in JavaScript as follows:
1. Number.EPSILON
2. Number.MAX_VALUE
3. Number.MIN_VALUE
4. Number.MAX_SAFE_INTEGER
5. Number.MIN_SAFE_INTEGER
6. Number.POSITIVE_INFINITY
7. Number.NEGATIVE_INFINITY
8. NaN
The math.js file contains following math methods:
Math.round() Math.trunc()
Math.ceil() Math.sign()
Math.floor() Math.pow()
Math.squrt() Math.abs()
Math.min() Math.random()
Math.max() Math.
The date.js file contains the synatx and basic syntax of date object.
DateMethod
The date_method.js file contains a few mostly used date moethods such as:
toDateString() getFullYear()
toUTCString() getDay()
toLocaleString() getDate()
toJSON()
The class.js contains the defination and the syntax for creating a class.
b. class_inheritence.js
This file includes the practical example of class inheritence in JavaScript.
In destructure.js contains practical examples of array destructuring.
Spread Opertor intoduced in ES6 and allows quick copy all or part of the array or an object. The spread_operaotr.html
includes example of spread operator as follows:
const number1 = [100, 200, 300];
const number2 = [400, 500, 600];
const combination = [...number1, ...number2];
document.write(combination);
// It combines and prints all values in both arrays.
const myNumbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
// In the following line, we assigned the 1 and 2 to the variables one, and two and the rest to the array named restInArray
const [one, two, three, ...restInArray] = myNumbers;
document.write("<p>" + one + "</p>"); // prints to the console
document.write("<p>" + two + "</p>"); // prints to the console
document.write("<p>" + restInArray + "</p>"); // prints to the console
/*
It will return:
1
2
3,4,5,6,7,8,9,10
*/
It also includes a spread operator working with objects:
const myVehicle = {
brand: 'Ford',
model: 'Mustang',
color: 'red'
}
const updateMyVehicle = {
type: 'car',
year: 2021,
color: 'yellow'
}
const myUpdatedVehicle = {...myVehicle, ...updateMyVehicle}
// prints it into the console
console.log(myUpdatedVehicle);