MLMehul Lakhanpalincodedrops.hashnode.dev·May 4, 2022 · 1 min readLooking for collaborators for my next projectHi, I am Mehul, Senior Frontend Engineer at Toddle. I make side projects in my free time & do all the development, logo design, video editing, UI, marketing, etc all by myself. Some of my solo projects: Array Builder - A free tool to visualize the o...00
MLMehul Lakhanpalincodedrops.hashnode.dev·May 1, 2022 · 1 min readA new way to construct/debug ArraysA few days back while I was working I wrote a long block of code that made use of map, reduce & filter. Without testing I finished the code assuming it's gonna work but it broke. I had to console.log every operation to debug it. It was a minor issue,...00
MLMehul Lakhanpalincodedrops.hashnode.dev·Jul 6, 2021 · 1 min readuseToggle: Custom react hook for toggle// File: useToggle.js import { useState } from "react"; const useToggle = (initialState = false) => { const [visible, setVisibility] = useState(initialState); const toggle = () => setVisibility((prev) => !prev); const setToggleStatus = (valu...00
MLMehul Lakhanpalincodedrops.hashnode.dev·Jun 21, 2021 · 1 min readLodash: _.isEmpty() - Check falsy values_.isEmpty(): Matches undefined, null, false & empty arrays, obj, strings const _ = require('lodash'); console.log( _.isEmpty(undefined), _.isEmpty(null), _.isEmpty(false) _.isEmpty([]), _.isEmpty({}), _.isEmpty(""), ); // true x 600
MLMehul Lakhanpalincodedrops.hashnode.dev·Jun 15, 2021 · 1 min readCalling an async function without awaitconst asyncFunction = async () => "HELLO"; const main = async () => { const value = asyncFunction(); console.log(value === "HELLO" ? "true" : "false"); }; main(); Output: false asyncFunction() returns a promise not the resolved value.00