# 2. Null Vs Undefined

`let demo;console.log(demo); //shows undefinedalert(typeof demo); //shows undefined`
`let demo = null;console.log(demo); //shows nullalert(typeof demo); //shows object`

# 3. == Vs === (Double equals Vs Triple equals sign)

`11 == '11' // returns true but,11 === '11' // returns false`

# 4. Implicit coercion

`2 + '2' // returns 42 * [2] // returns 4`

# 8. Find the largest element of an array

`const myArr = [2, 3, 7, 6, 4, 9];console.log(Math.max.apply(null, myArr)); // returns 9`

# 9. Sum of all numbers in an array

`const arr = [1, 2, 3, 4, 5];          // Getting sum of numbers    const reducer = (accumulator, currentValue) => accumulator + currentValue;      console.log(array1.reduce(reducer)); // returns 15`

# 10. Remove duplicate item from an array

`function findUnique(array){        let uniqueArray = [];                // Loop through array values        for(i=0; i < array.length; i++){            if(uniqueArray.indexOf(array[i]) === -1) {                uniqueArray.push(array[i]);            }        }        return uniqueArray;    }        const names = ["John", "Peter", "Clark", "Harry", "John", "Alice"];    let uniqueNames = getUnique(names);    console.log(uniqueNames); // Prints: ["John", "Peter", "Clark", "Harry", "Alice"]`

## Show some love for Mocha api tests! Setting up #1

Get the Medium app