In this tutorial, we will learn what “javascript: void(0)” means. In English, void means nothing. In a programming language, void means return nothing. “javascript: void(0)” is similar to void. javascript: void(0) means return undefined as a primitive value. We use this to prevent any negative effects on a webpage when we insert some expression. For example, in the case of URL hyperlinks. Hyperlinks open by reloading the page when the user clicks on the link. When you need to run some other code in such cases, you can use javascript: void(0). Let’s split javascript: void(0) with a colon. We get ... Read More
In this article, we will show you how to calculate the inverse of a matrix or ndArray using NumPy library in python. What is inverse of a matrix? The inverse of a matrix is such that if it is multiplied by the original matrix, it results in an identity matrix. The inverse of a matrix is just the reciprocal of the matrix, as in regular arithmetic, for a single number that is used to solve equations to obtain the value of unknown variables. The inverse of a matrix is the matrix that, when multiplied by the original matrix, produces the ... Read More
In this tutorial, we will discuss plugins in JavaScript. So what is a plugin? A plugin is a JavaScript code written in a file. This file supplies various methods that we can use for various purposes. A plugin has an entry in the array. An entry has following properties − name − The name is the plugin name. filename − filename is the executable file loaded to install the plugin with the extension. description − description is the developer's(manufacturer's) description of the plugin. mimeTypes − mimeTypes is an array with one entry for each MIME type that the plugin ... Read More
In this article, we will learn what characters are valid for JavaScript variable names. We use variables to save values. First, we have to define the variable, and then we can assign a value to it. We can use the variable name to access the variable in the code. With a variable name, we can reassign its value. As you adhere to a few principles, variable names are quite versatile. Rules A letter, dollar sign($), or underscore (_) must make up the first character. A number cannot be the initial character. Any letter, number, or underscore can complete the ... Read More
In this article, we will show you how to flatten a matrix using the NumPy library in python. numpy.ndarray.flatten() function The numpy module includes a function called numpy.ndarray.flatten() that returns a one-dimensional copy of the array rather than a two-dimensional or multi-dimensional array. In simple words, we can say that it flattens a matrix to 1-Dimension. Syntax ndarray.flatten(order='C') Parameters order − 'C', 'F', 'A', 'K' (optional) When we set the order parameter to 'C, ' the array is flattened in row-major order. When the 'F' is set, the array is flattened in column-major order. Only when 'a' is ... Read More
In this tutorial, let us discuss the three types of errors we can expect in our JavaScript code. Errors are statements that block the execution of the program. During the compilation of the program, three types of errors can occur. These are syntax errors, run time errors, and logical errors. Syntax Errors Syntax errors are usual errors. Incorrect syntax causes parsing issues during the code interpretation. For example, add a semicolon instead of a colon in an object declaration. Syntax errors affect only the respective code thread. The remaining code works as it is. A grammatical mistake is the ultimate ... Read More
In this tutorial, we will learn how we can find the coordinates of the mouse cursor with JavaScript. We have to find out the X and Y-coordinates or we can say that the horizontal and the vertical position of the cursor on the screen with JavaScript. JavaScript provides us with two different properties to get the coordinates of the mouse cursor when the mouse button is pressed anywhere on the screen − Using event.clientX Property Using event.clientY Property Using event.clientX Property The event.clientX property is used to find out the value of the horizontal position or the X-coordinate ... Read More
In this tutorial, we will discuss the rules to follow for Object Definitions in JavaScript. JavaScript is an object-oriented scripting language. An object contains many properties. The property consists of a key and a value. The property is known as a method when this value is a function. Predefined objects are available in the browser. We can also define our objects. A real-life example of an object is a cup. The color, design, weight, and material are the main properties of a cup. The object name and the property name are case-sensitive. To define a property, we need to assign ... Read More
In this tutorial, we will learn how we can fill columns with JavaScript. Use the columnFill property to fill columns. Fill it as auto to fill sequentially, or balance to equally divide content between columns. The columnFill property is the property that specifies how the columns should be filled, auto, balanced, or in any other manner. Syntax Following is the syntax to set the columnFill property in JavaScript − selectedElement.style.columnFill="value"; Here the selectedElement is the element to which you want to add the columnFill property, while using style is the way of adding any CSS property to an element ... Read More
In this tutorial, we will discuss the properties of the window.screen object in JavaScript. The window comes under the Browser Object Model – BOM. The window's screen object holds information on the user's screen. Because the scope of the window object is high, we can also write the window's screen object as "screen". There are no direct methods for the screen object. The object's use is to improve the UI experience of a webpage. Properties of window.screen Object availHeight The availHeight property returns the screen height, excluding the Windows Taskbar. availWidth The availWidth property returns the screen width, excluding the ... Read More