Found 6710 Articles for Javascript

decodeURI() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 13:04:20

104 Views

The decodeURI() function accepts a string value representing an encoded URI, decodesit and, returns the resultant string.SyntaxIts Syntax is as followsdecodeURI('http://www.qries.com/');Example    JavaScript Example           var result1 = decodeURI('http://www.qries.com/');       document.write(result1);       document.write("");       var result2 = decodeURI('http://www.tutorialspoint.com/');       document.write(result2);     Outputhttp://www.qries.com/ http://www.tutorialspoint.com/

decodeURIComponent() function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 13:04:46

264 Views

The decodeURIComponent() function accepts a string value representing an encoded URI (Uniform Resource Identifier) decodes it and returns the result.SyntaxIts Syntax is as followsencodeURIComponent('http://www.qries.com/');Example Live Demo    JavaScript Example           var encodedData = encodeURIComponent('http://www.qries.com/?x=шеллы');       document.write("Encoded Data: "+encodedData);       document.write("");       var decodedData = decodeURIComponent(encodedData);       document.write("Decoded Data: "+decodedData);     OutputEncoded Data: http%3A%2F%2Fwww.qries.com%2F%3Fx%3D%D1%88%D0%B5%D0%BB%D0%BB%D1%8B Decoded Data: http://www.qries.com/?x=шеллы

encodeURI() function in JavaScript

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

125 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

encodeURIComponent() function in JavaScript

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

117 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

eval() function in JavaScript

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

369 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

isFinite() function in JavaScript

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

58 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

isNAN() function in JavaScript

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

503 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

parseFloat() function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 12:55:38

159 Views

The parseFloat() function accepts two parameters one is a string representing a number and another is a number representing the radix and returns an integer of the given radix.SyntaxIts Syntax is as followsnum.parseFloat('4524', 8);Example Live Demo    JavaScript Example           var result1 = parseFloat(Math.PI);       document.write("Result: "+result1);       document.write('');       var result2 = parseFloat("245.12@welcome");       document.write("Result: "+result2);       document.write('');       var result3 = parseFloat("11111100.010");       document.write("Result: "+result3);     OutputResult: 3.141592653589793 Result: 245.12 Result: 11111100.01

parseInt() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 12:56:34

549 Views

The parseInt() function accepts two parameters one is a string representing a number and another is a number representing the radix and returns an integer of the given radix.SyntaxIts Syntax is as followsnum.parseInt('4524', 8);Example Live Demo    JavaScript Example           var result = parseInt('4524', 8);       document.write("Result: " + result);     OutputResult: 2388Example Live Demo    JavaScript Example           var result1 = parseInt('4524', 8);       document.write("Result: " + result1);       document.write("");       var result2 = parseInt('4524', 10);       document.write("Result: " + result2);       document.write("");       var result3 = parseInt('4524', 16);       document.write("Result: " + result3);     OutputResult: 2388 Result: 4524 Result: 17700

SharedArrayBuffer.byteLength Property in JavaScript

karthikeya Boyini
Updated on 30-Jul-2019 22:30:23

98 Views

The byteLength property of the SharedArrayBuffer returns an unsigned, 32-bit integer that specifies the size/length of a SharedArrayBuffer. Syntax Its Syntax is as follows sharedArrayBuffer.byteLength Example Live Demo JavaScript Example var sharedArrayBuffer = new SharedArrayBuffer(8); var result = sharedArrayBuffer.byteLength; document.write("length of the shared array buffer is: " + result); Output length of the shared array buffer is: 8

Advertisements