JavaScript Coder


Using Try…Catch in JavaScript

Errors are almost inevitable in JavaScript programs. As a JavaScript developer, it is your responsibility to anticipate errors and handle them effectively. This will ultimately help you to create programs which are robust, reliable and efficient. One simple way of handling errors is through try…catch statements. A try…catch statement is a programming mechanism which enables you to test your code for possible errors, and carry out certain actions in case an error occurs.

Continue Reading →

How to escape double qoutes in a string

There are many different ways to escape quotes in a string. This article will show each one. Escaping string literals If you just want to escape string literals, here are the ways to do it. There are at least three ways to create a string literal in Javascript - using single quotes, double quotes, or the backtick ( ). So, if you enclose your string in single quotes, no need to escape double quotes and vis versa.

Continue Reading →