• JavaScript: forEach loop does not work in promise or async function

    The implementation of forEach loop is not compatible with promise and async functions. Use a for loop to work around this limitation.

  • JavaScript: substring() vs substr()

    substring() returns the characters of a string from a starting index to an end index, substr() on the other hand, returns an n number of characters from a starting index.

  • JavaScript: bind() vs apply() and call()

    What is the difference between bind(), apply(), and call()? Let's start with a quick summary of .bind(), .apply(), and .call(), with this object:

  • JavaScript: Array-like objects

    What are array-like objects in JavaScript? Have you heard about array-like objects in JavaScript? If no, this is a good post to learn about them. Array-like objects are not a separate object type, th...

  • JavaScript: Use variables in Regular Expressions

    How to use variables in Regular Expression So you know the basics of Regular Expressions in JavaScript and often use it for replacing text etc. Example: var sentence = 'Regular Expression'; sentence....

  • JavaScript: Check if object property is defined

    How to check if a property is defined in an object Probably you know how to check if a variable is defined in JavaScript or not (without crashing your app with a fatal ReferenceError). In case you di...