JavaScript Objects JavaScript Objects is one of the built-in data types, that are used to store key-value pairs. Objects in JavaScript are Variables too, but they can contain many values. Below is an example of a JavaScript Object: Example In an above Example, we have created an object a , and declare several properties inside […]
Difference Between Array and Variable
Difference Between Array and Variable In Programming, most of the beginners get confused between the Variable and an Array. Some thought Variable and Array are same, and some know they both are different, but they don’t know the difference. To understand the difference between variable and an arrays, let me briefly tell you what are […]
JavaScript Arrays
JavaScript Arrays JavaScript Arrays is a data structure that is used to collect the elements of same Data Type. Arrays are the great way to store and manipulate collections of data. Here is a syntax of JavaScript array: Syntax: Why Use Arrays If you have any type of list (let’s say list of students), and […]
JavaScript init Function
JavaScript init Function JavaScript init Function is a function that is used to initialize an object. Initialization is the process of setting up the initial values of an object’s properties. When an object is created, an init function is typically called to set its initial state. An init function is not a built-in JavaScript function, […]
JavaScript Check if Function Exists
JavaScript Check if Function Exists JavaScript gives us a method to check if a function exists or not. We can check it using the typeof operator and an if condition. Using typeof Operator To check if a function exists in JavaScript or not, we can use the typeof operator. This operator will check whether the […]
Functions in JavaScript
JavaScript Functions is a block of code that is designed to perform a specific task. Functions can be defined using the function
JavaScript Output
JavaScript Output JavaScript Output specifies the ways to display the output of a given JS code. The output can be specified by using four different ways. These are: 1. InnerHTML:- This method is used to access an element. It specifies the HTML content. Example Here the id attribute specifies the HTML element. The property innerHTML […]
Introduction to JavaScript
Introduction to JavaScript JavaScript is a simple, easy-to-learn, quick and powerful programming language, which can be used in all kinds of websites. It provides a lot of opportunities for you to create more interactive websites than merely static html pages. JavaScript is a server-side programming language. As such, it runs on the client side of […]