TypedArray Fill Function in JavaScript

Samual Sam
Updated on 25-Jun-2020 13:09:24

115 Views

The fill() function of the TypedArray object replaces all the required/desired elements of the array with specifies value (fixed). This function accepts three numbers one representing a fixed value and the other two represents the start and end indexes of the portion of the elements to be replaced (end value is optional).SyntaxIts Syntax is as followsint32View.fill(464, 3);Example Live Demo    JavaScript Array every Method           var int32View = new Int32Array([64, 89, 65, 21, 14, 66, 87, 55]);       document.write("Contents of the typed array: "+int32View);       document.write("");       result ... Read More

Usage of cubic-bezier CSS Function

George John
Updated on 25-Jun-2020 13:09:09

271 Views

To define a Cubic Bezier curve, use the cubic-bezier() function. You can try to run the following code to implement the cubic-bezier() functionExampleLive Demo                    div {             width: 100px;             height: 100px;             background: yellow;             transition: width 3s;             transition-timing-function: cubic-bezier(0.3, 0.3, 2.0, 0.9);          }          div:hover {             width:200px;          }                     Hover over the below container:          

TypedArray Filter Function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 13:08:55

73 Views

The filter() function of TypedArray accepts a string value representing the name of a function, tests whether all the elements in an array passes the test implemented by the provided function, creates a new array with all elements that pass the test.SyntaxIts Syntax is as followstypedArray.filter(function_name)Example Live Demo    JavaScript Array every Method           var int32View = new Int32Array([64, 89, 65, 21, 14, 66, 87, 55 ]);       document.write("Contents of the typed array: "+int32View);       document.write("");       function testResult(element, index, array) {          var ele ... Read More

Set the Name to Grid Items with CSS

Sreemaha
Updated on 25-Jun-2020 13:08:33

162 Views

To set names to grid items in CSS, use the grid-area property, with the grid-template-areas property:ExampleLive Demo                    .container {             display: grid;             background-color: green;             grid-template-areas: 'demo demo . . .' 'demo demo . . .';             padding: 20px;             grid-gap: 10px;          }          .container > div {             background-color: orange;             text-align: center;             padding: 10px 0;             font-size: 20px;          }          .ele1 {             grid-area: demo;          }                     Game Board                1          2          3          4          5          6          

Select Increment Counter in MySQL

Chandu yadav
Updated on 25-Jun-2020 13:08:29

7K+ Views

To select increment counter in MySQL, first you need to declare and initialize a variable. The syntax is as follows −set @anyVariableName=0; select yourColumnName, @anyVariableName:=@anyVariableName+1 as anyVariableName from yourTableName;To understand the above syntax and set an increment counter, let us first create a table. The query to create a table is as follows.mysql> create table incrementCounterDemo -> ( -> Name varchar(100) -> ); Query OK, 0 rows affected (1.01 sec)Insert some records in the table using insert command. The query is as follows.mysql> insert into incrementCounterDemo values('John'); Query OK, 1 row affected (0.18 sec) mysql> insert into incrementCounterDemo values('Carol'); ... Read More

isNaN Function in JavaScript

Samual Sam
Updated on 25-Jun-2020 13:08:12

540 Views

The isNaN() function accepts a value and determines whether the given value is a number or not.If so, this method returns true else it returns false. You can also call this method using Number object.SyntaxIts Syntax is as followsisNAN(5655);Example Live Demo    JavaScript Example           var result1 = parseFloat("Ef00A.D3");       document.write(isNaN(result1));       document.write('');       var result2 = Math.log("welcome");       document.write(isNaN(result2));       document.write('');       var result3 = Math.log(1254);       document.write(isNaN(result3));     Outputtrue true false

isFinite Function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 13:07:19

76 Views

The isFinite() function accepts a value and determines whether the given value is a finite number or not. If so, this method returns true else it returns false. You can also invoke this method using Number object.SyntaxIts Syntax is as followsisFinite(5655);Example Live Demo    JavaScript Example           var result1 = Math.min();       document.write(isFinite(result1));       document.write("");       var result2 = Number.isFinite(100/0);       document.write(result2);       document.write("");       var result3 = Math.max(25, 36, 862);       document.write(isFinite(result3));     Outputfalse false true

Eval Function in JavaScript

Samual Sam
Updated on 25-Jun-2020 13:06:30

395 Views

The eval() function accepts a string value which holds JavaScript code. This function executes the given code and returns the result of the code.SyntaxIts Syntax is as followseval(32*45);Example Live Demo    JavaScript Example           document.write(eval(32*45));       document.write("");       document.write(eval(new String("Hello welcome to Tutorialspoint")));     Output1440 Hello welcome to Tutorialspoint

encodeURIComponent Function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 13:06:05

133 Views

The encodeURIComponent() function accepts a string value representing an URI and encodes it by replacing the characters in it using numbers (1 to 4) and escape sequence.SyntaxIts Syntax is as followsencodeURIComponent('http://www.qries.com/');Example Live Demo    JavaScript Example           var result1 = encodeURIComponent('http://www.qries.com/');       document.write(result1);       document.write("");       var result2 = encodeURIComponent('http://www.tutorialspoint.com/');       document.write(encodeURIComponent(result2));     Outputhttp%3A%2F%2Fwww.qries.com%2F http%253A%252F%252Fwww.tutorialspoint.com%252F

encodeURI Function in JavaScript

Samual Sam
Updated on 25-Jun-2020 13:05:23

139 Views

The encodeURI() function accepts a string value representing an URI and encodes it by replacing the characters in it using numbers (1 to 4) and escape sequence.SyntaxIts Syntax is as followsencodeURIComponent('http://www.qries.com/');Example Live Demo    JavaScript Example           var result1 = encodeURI('http://www.qries.com/?x=шеллы');       document.write(result1);       document.write("");       var result2 = encodeURI('http://www.tutorialspoint.com/?x=шеллы');       document.write(result2);     Outputhttp://www.qries.com/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B http://www.tutorialspoint.com/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B

Advertisements