Hello. I'm a Software Engineer from Bangladesh. I like all things JS may it be vanilla or fancy like Next.js. In my free time I like to read, listen to music and climb mountains but currently busy centering divs.
Nothing here yet.
You got that right. Whenever we try to access an object property that doesn't exists, we get undefined . So we can use this feature to check if an object property exists or not. For example, let str = "The quick brown fox" let freq = {} str.split( "" ).forEach( char => { freq[char] === undefined ? freq[char] = 1 : freq[char] += 1 }) console .log(freq) This little piece of code makes JS objects behave like hashmaps and count the character frequency in the str string.