Skip to content

Instantly share code, notes, and snippets.

View thisiskhan's full-sized avatar
:octocat:
git push | git pull

Raza Khan thisiskhan

:octocat:
git push | git pull
View GitHub Profile
@thisiskhan
thisiskhan / Dataypes.js
Last active June 7, 2021 09:03
Data Types js
/* Data Types:
Undefined, null, booleans, String, Symbols, number, and objects;
*/
/*
Symbols: Symbols are immutable and are unique
*/
const val1 = Symbol("Hello")
const val2 = Symbol("Hello")
console.log(val1 == val2) //false
// Spread & Rest Operators
/*
Spread: Used to split up arrow elements OR object properties.
const nnewarray = [...oldArray, 1,2]
const newObject = {...oldObject, newProp:5}
Rest: Used to merge a lost of functions argumnets into array.
function sortArray(...arg){
return args.sort()
}
*/