The break statement is used to break a loop and continue executing the code, which is after the loop.ExampleYou can try to run the following code to break a loop in JavaScriptLive Demo var text = ""; var i; for (i = 0; i < 5; i++) { if (i === 2) { break; } text += "Value: " + i + ""; } document.getElementById("test").innerHTML = text; OutputValue: 0 Value: 1
The CSS background-position property is used to set an initial position for a background image relative to the origin.SyntaxThe syntax of CSS background-position property is as follows −Selector { background-position: /*value*/ }The following examples illustrate CSS background-position property −Example Live Demo div { margin: 30px; padding: 100px; background-image: url("https://www.tutorialspoint.com/images/C-programming.png"), url("https://www.tutorialspoint.com/images/Swift.png"), url("https://www.tutorialspoint.com/images/xamarian.png"); background-repeat: no-repeat; background-position: 15% 20%, top, right; border: 1px solid; } OutputThis gives the following output −Example Live Demo p { margin: 20px; padding: 80px; background-image: url("https://www.tutorialspoint.com/images/dbms.png"), url("https://www.tutorialspoint.com/images/Operating-System.png"); ... Read More
It performs XOR operation on the right operand with the left operand and assigns the result to the left operand.ExampleYou can try to run the following code to learn how to work with Bitwise XOR Assignment OperatorLive Demo var a = 2; // Bit presentation 10 var b = 3; // Bit presentation 11 document.write("(a ^= b) => "); document.write(a ^= b);
To redirect from an HTML page, use the META Tag. With this, use the http-equiv attribute to provide an HTTP header for the value of the content attribute. The value of the content is the number of seconds; you want the page to redirect after.Through this, you can automatically redirect your visitors to a new homepage. Set the content attribute to 0, if you want it to load immediately.ExampleThe following is an example of redirecting current page to another page after 2 seconds.Live Demo Redirection This page will redirect in 2 seconds.
Use Math.abs() inside a JavaScript function to get the difference between two numbers in JavaScript.ExampleYou can try to run the following code to get the difference of numbersLive Demo var num1, num2; num1 = 50; num2 = 35; var difference = function (num1, num2){ return Math.abs(num1 - num2); } document.write("Difference = "+difference(num1,num2));
A JavaScript function can have an optional return statement i.e. it’s optional to return a value. This statement should be the last statement in a function.For example, you can pass two numbers in a function and then you can expect the function to return their multiplication to your calling program.ExampleTry the following example. It defines a function that takes two parameters and concatenates them before returning the resultant in the calling program.Live Demo function concatenate(first, last){ var full; full = first ... Read More
To call a parent window function, use “window.top”.ExampleYou can try to run the following code to call a parent window function from an iframeLive Demo function display(){ alert("Hello World!"); } Click
In case of computational geometry, a planar straight-line graph, in short PSLG, (or straight-line plane graph, or plane straight-line graph) is defined as a term implemented for an embedding of a planar graph in the plane such that its edges are mapped into straight line segments. Statement of Fáry's theorem (1948) is that every planar graph has this kind of embedding.In case of computational geometry, PSLGs have often been termed planar subdivisions, with an assumption or assertion that subdivisions are polygonal.Without vertices of degree 1, a PSLG defines a subdivision of the plane into polygonal regions and vice versa. Absence ... Read More
Multivariate cross-sectional data (i.e. not time-series or repeated measure) are indicated by rectangular data in which each column is a variable (feature), and each row is a case or record.First procedure of representing rectangle data is to map it onto a higher-dimensional point data and use point-based data structure procedures such as the grid file, PR quadtree, point quadtree, and k-d-tree. Procedure mapping of the rectangular data to a four-dimensional point can be performed in number techniques such as x and y coordinates of the opposite corners, or x and y coordinates of one corner and the width and height, ... Read More
Bucketing builds, the hash table as a 2D array instead of a single dimensional array. Every entry in the array is big, sufficient to hold M items (M is not amount of data. Just a constant).ProblemsLots of wasted space are created.If M is exceeded, another strategy will need to be implemented.Not so good performer for memory based implementations but doable if buckets are disk-based.For bucketing it is ok to have λ>1. However, the larger λ is the higher a chance of collision. λ>1 guarantees there will be minimum 1 collision (pigeon hole principle). That will enhance both the run time ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP