The substr() method returns the characters in a string beginning at the specified location through the specified number of characters. Syntax, parameters, examples of substr() in Javascript are as below.

Read More

substring() is one of the main string function which is mostly used in javascript. The substring() method extracts the characters from a string, between two specified indices, and returns the new sub string.

Read More

JavaScript arrays are commonly used by developers and making them empty is also used in practice. Here I am describing 4 ways to empty an array in JavaScript:

1. Use splice() method
2. Set length to zero
3. Using pop() method
4. Set array to new empty array

Read More

Add and Remove Classes using JavaScript is quite handy. Even it’s better to use a JavaScript framework or a library for such common tasks and I have mentioned the reason behind doing so at the end of article, these JavaScript code to adding and removing classes are worth considerable.

Read More

Making a try it yourself editor is a very easy and 5 minutes task if you know the concept behind it. Here I’m telling you step by step to create a try it yourself editor like w3 schools that would be able to run your HTML, CSS and javascript code online and display the result in iframe.

Read More

[ Page 3 of 4 ]