Posts for Javascript

Deven
Deven wrote

How to trigger enter key in JavaScript

In this article, you are going to learn about how to trigger an enter key in JavaScript. Basically, we submit a form input by clicking on the button. But sometimes you need to implement the functionality where form input will be submitted by pressing an enter key from the keyboard. It is easy to implement […]

December 2, 2021 in Code examples
Deven
Deven wrote

How to do input focused in JavaScript

In this article, you will learn about how to focus an input field by using JavaScript. JavaScript is a text-based programming language that is used both on the client-side and server-side. You can bring activity to your web page and make web pages interactive. Input focused is one kind of interactivity that you can use […]

December 2, 2021 in Code examples
Deven
Deven wrote

in vs hasOwnProperty in JavaScript

In this article, you are going to learn about the difference between hasOwnProperty and in. In JavaScript, an object is a self-sustained entity, with properties and type. Compare it with a person, for example. A person is an object, with properties. A person has eyes, legs, weight, ears, hands, etc. In the same way, JavaScript […]

December 2, 2021 in Code examples
Deven
Deven wrote

How to redirect with express

In this article, you will learn about how to redirect with express. Express is a popular backend web application framework for nodejs. It is mainly designed for building web applications and APIs. Express lets you write server-side logic for web and mobile applications. You can easily redirect a URL in express to do so you […]

December 1, 2021 in Code examples
Deven
Deven wrote

​​How to make a POST JSON request with Axios

In this article, you will learn about Post JSON request with Axios. In JavaScript, Axios is a library that is used to make HTTP requests from Node and is also used in front-end applications. It is a promise-based API. You can Post JSON requests with Axios by calling axios.post() method. This method simply expects two […]

December 1, 2021 in Code examples
Deven
Deven wrote

How to get selected option value in jQuery

In this article, you are going to learn about how to get selected options value in jQuery. jQuery is a speedy, lightweight, and easy-to-learn JavaScript library. With this library, you can manipulate the HTML DOM tree as well as event handling and bring interactivity to your web page. jQuery provides lots of library methods, :selected […]

November 1, 2021 in Code examples
Deven
Deven wrote

How to continue forEach in javaScript

In this article, you will learn about how to continue forEach loop in javaScript. In JavaScript, forEach loop is considered as an array method that executes a custom callback function on each item in an array. You can use forEach loop only on the array. Let’s see a forEach loops example first: Suppose you have […]

October 27, 2021 in Code examples
Deven
Deven wrote

How to use Object.keys in forEach

In this article, you will learn about how to use Object.keys() in forEach. In JavaScript an Object is a data type that is used to store various types of collection and complex entities. forEach loop is only used on the array. You can not use it to iterate the properties of an Object directly. To […]

October 27, 2021 in Code examples
Deven
Deven wrote

How to break forEach in JavaScript

In this article, you will learn about how to break forEach loop in JavaScript. In JavaScript, forEach loop is considered as an array method that executes a custom callback function on each item in an array. You can use forEach loop only on the array. Let’s see a forEach loops example first: Suppose you have […]

October 27, 2021 in Code examples
Deven
Deven wrote

How to use string interpolation in Javascript

In this article, you will learn about JavaScript string interpolation. In JavaScript, string interpolation is the process of evaluating a string literal containing one or more placeholders and expecting the result in which the placeholders are replaced with their desired values. In simple terms, it is the process of embedding an expression into part of […]

October 27, 2021 in Code examples
Deven
Deven wrote

How to flatten an array in JavaScript

In this article, you will learn about how to flatten an array in JavaScript. In JavaScript, an array is used to stores multiple data in a single variable. Array can be one dimensional or multi-dimensional. Flatten an array in JavaScript means reduce the multiple dimensions of array into an single array. Suppose you have a […]

October 27, 2021 in Code examples
Deven
Deven wrote

How to check a value contains in Javascript array

In this article, you will learn about how to check a value that contains in the JavaScript array. An array in JavaScript can be stored different elements into a single variable. In JavaScript, elements can be a primitive value like String, Number, etc. JavaScript lets you check a value that exists in the array or […]

October 27, 2021 in Code examples
Deven
Deven wrote

How to check Javascript null

In this article, you will learn about how to check null in JavaScript. JavaScript comes with a special type of value named null. In JavaScript, it is a primitive type value and represents an intentional absence of any Object value. Null is considered as a boolean type value and by default, it is treated as […]

October 27, 2021 in Code examples
Deven
Deven wrote

complete Guide to Local storage in Javascript

JavaScript is the queen of all programming languages. It has been ruling in the web development sector over the years. JavaScript comes with tones of useful features by which you can bring more interactivity to your website. local storage is one of them. In JavaScript local storage is a property that allows JavaScript sites and […]

October 21, 2021 in Javascript & Tutorials