Everything you need to know about error handling in Javascript

Exception handling is the way that we can prevent abnormal program termination on runtime due to some Exception. For example In the above case, instead of termination of the program, we can handle it by try…catch block. Any error inside try block doesn’t cause program termination. If an error is caused inside the try block …

Introduce Yourself (Example Post)

This is an example post, originally published as part of Blogging University. Enroll in one of our ten programs, and start your blog right. You’re going to publish a post today. Don’t worry about how your blog looks. Don’t worry if you haven’t given it a name yet, or you’re feeling overwhelmed. Just click the …

A short introduction to CSS variables

Using CSS variables we can set a value to a property and reuse it in our CSS code. This can be thought of almost exactly how we use variables in JavaScript. When do we need CSS variables? When we are working on a project, and we need to use the same value (text color, background, …

Converting a string to camelCase in Javascript

Learn how to convert a string into camelCase in Javascript. image from wikipedia camelCase: Camel case (stylized as camelCase; also known as camel caps or more formally as medial capitals) is the practice of writing phrases such that each word or abbreviation in the middle of the phrase begins with a capital letter, with no …

First class Function in Javascript.

Learn about what is first class function and how to use it , in Javascript. A programming language is said to support First class function , if A function can be assigned to a variable, 2. A function can be passed as an argument, 3. A function can be returned from other function. A function can be …

Understand the bind() function in Javascript

The .bind() function allows as to create a function by setting a custom this value. The bind function returns a function that is callable like a normal function and can also be passed to other functions. When we need to go for bind ? Consider that we have an object: window.Name = “Window”; var JsJeep = { …

Take screenshot 📱with Javascript .

Learn how to take screenshot with javascript . To use the webcam or microphone, we need to request permission.We can request the access using getUserMedia() function , The getUserMedia() function takes constraint as argument . The constraint object contains either you need to access webcam , audio, or both. If you want to access the webcam, the parameter should …

Check if your variable is an Array in Javascript.

Learn Different ways to check if a variable is array in Javascript. Using Array.isArray() Using toString() method in Object, this method convert the argument to specific type name, If we pass Object.prototype.toString.call(1) returns “[object Number]” , so if we pass array then it results in “[object Array]” . Using instanceof keyword arr instanceof Array; Using toString method …

Design a site like this with WordPress.com
Get started