• 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...

  • JavaScript: Array slice() with examples

    JavaScript array.slice() explained with examples .slice() is a method on all instances of arrays in JavaScript. It accepts two parameters - start index and end index - both of which are optional, and...

  • JavaScript: apply and call

    What are apply() and call() in JavaScript? apply and call are two of the less encountered and less well understood aspects of JavaScript, primarily because of their unfamiliarity. Why are they unfami...

  • JavaScript: Get object size

    How to get the size of an object in JavaScript Arrays in JavaScript have a length property that gives you the number of items in an array. Objects on the other hand, don't have a length or size prope...

  • JavaScript: get the number of properties in an object without looping

    How to get the number of properties in a JavaScript object without looping Unlike arrays, JavaScript objects do not a have a length property which gives you the number of properties / items in an obj...