#beginners
Read more stories on Hashnode
Articles with this tag
_.isEmpty(): Matches undefined, null, false & empty arrays, obj, strings const _ = require('lodash'); console.log( _.isEmpty(undefined), ...
const asyncFunction = async () => "HELLO"; const main = async () => { const value = asyncFunction(); console.log(value === "HELLO" ? "true" :...
snake_case kebab-case camelCase (JS variables, functions) PascalCase (JS Classes) SCREAMING_SNAKE_CASE (JS constants)
const getDayNameOrNo = (value) => { const mappings = [ [0, "sunday"], [1, "monday"], [2, "tuesday"], [3, "wednesday"], [4,...
const repeatFn = (n, fn) => { const results = []; for (let i = 0; i < n; i++) { results.push(fn()); } return results; }; const result =...
Empty states and values are always checked. It throws an error if the array is 'undefined' or 'null'. There has to be a message if there is no data....