Javascript

Measure execution time of a function using javascript

You can measure the performance of javascript code using console.time() function. This can be helpful in debugging and optimizing code which is taking lot of memory. console.time() can be used with console.timeEnd(). console.timeEnd() function tells console to stop calculating the time. You will see result as below: Running loop :0 timesRunning loop :1 timesRunning loop […]

Measure execution time of a function using javascript Read More »

Check if a string is a palindrome or not using javascript

What is a palindrome? Palindrome is a word or phrase which reads same if reversed.  For example – if we reverse Racecar it will read the same both backward or forwards. A few examples of words that are palindrome are Noon, Racecar, Wow, Refer, etc.

Check if a string is a palindrome or not using javascript Read More »

Scroll to Top