14 December, 2018

TIL #5 - js debugging tip

Notes taken between: 10-14 December 2018


JS

javascript if condtion isnt met it will just return undefined!

add this line before your code to debug! debugger; // eslint-disable-line

you can use filter to remove something from an array

const array = [undefined, 3, 4, 5];
const cleanArray = array.filter(item => item);

console.log("Array: ", array);
console.log("cleanArray: ", cleanArray);