Found 10483 Articles for Web Development

Map.size property in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 12:16:07

633 Views

The size property of Map object accepts a JSON string, and constructs an object based on the given text and, returns it.SyntaxIts Syntax is as followsmapVar.sizeExample Live Demo    JavaScript Example           var mapVar = new Map();       mapVar.set('1', 'Java');       mapVar.set('2', 'JavaFX');       mapVar.set('3', 'HBase');       mapVar.set('4', 'Neo4j');       document.write("Size of the map object: "+mapVar.size);     OutputSize of the map object: 4

Map.set() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 12:02:43

79 Views

The set() function of Map object adds or updates elements (key-value pairs) to a Map object.SyntaxIts Syntax is as followsmapVar.set()Example Live Demo    JavaScript Example           var mapVar = new Map();       mapVar.set('1', 'Java');       mapVar.set('2', 'JavaFX');       mapVar.set('3', 'HBase');       mapVar.set('4', 'Neo4j');       document.write(mapVar.has('3'));     Outputtrue

JSON.parse() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 12:03:33

198 Views

The JSON.parse() function accepts a JSON string, and constructs an object based on the given text and, returns it.SyntaxIts Syntax is as followsJson.parse();Example Live Demo    JavaScript Example           var jsonSample = '{"Tutorial": "Java", "Version":8 }';       jsonObj = JSON.parse(jsonSample);       document.write("Tutorial Name: " + jsonObj.Tutorial);       document.write("");       document.write("Tutorial Version: " + jsonObj.Version);     OutputTutorial Name: Java Tutorial Version: 8

Date. toJSON() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 11:51:17

248 Views

The Date object is a data type built into the JavaScript language. Date objects are created with the new Date( ) as shown below.Once a Date object is created, a number of methods allow you to operate on it. Most methods simply allow you to get and set the year, month, day, hour, minute, second, and millisecond fields of the object, using either local time or UTC (universal, or GMT) time.The toJSON() function of the date object returns the simplified extended ISO format of the date.SyntaxIts Syntax is as followsdateObj.toJSON();Example Live Demo    JavaScript Example       ... Read More

Date.toISOString() function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 11:51:40

223 Views

The Date object is a datatype built into the JavaScript language. Date objects are created with the new Date( ) as shown below.Once a Date object is created, a number of methods allow you to operate on it. Most methods simply allow you to get and set the year, month, day, hour, minute, second, and millisecond fields of the object, using either local time or UTC (universal, or GMT) time.The toISOString() function of the date object returns the simplified extended ISO format of the date.SyntaxIts Syntax is as followsdateObj.toISOString();Example Live Demo    JavaScript Example         ... Read More

Date.getUTCMilliseconds() function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 11:36:41

106 Views

The Date object is a data type built into the JavaScript language. Date objects are created with the new Date( ) as shown below.Once a Date object is created, a number of methods allow you to operate on it. Most methods simply allow you to get and set the year, month, day, hour, minute, second, and millisecond fields of the object, using either local time or UTC (universal, or GMT) time.The getUTCMilliseconds() function of the Date object returns the milliseconds in the given date according to the universal time.SyntaxIts Syntax is as followsdateObj.getUTCMilliseconds();Example Live Demo    JavaScript Example ... Read More

Date.getUTCDay() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 11:38:48

77 Views

The Date object is a data type built into the JavaScript language. Date objects are created with the new Date( ) as shown below.Once a Date object is created, a number of methods allow you to operate on it. Most methods simply allow you to get and set the year, month, day, hour, minute, second, and millisecond fields of the object, using either local time or UTC (universal, or GMT) time.The getUTCDay() function of the Date object returns the day of the week of its current date according to the universal time. (0 represents Sunday and so on...)SyntaxIts Syntax is ... Read More

Date.now() function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 10:33:22

402 Views

The Date object is a data type built into the JavaScript language. Date objects are created with the new Date( ) as shown below.Once a Date object is created, a number of methods allow you to operate on it. Most methods simply allow you to get and set the year, month, day, hour, minute, second, and millisecond fields of the object, using either local time or UTC (universal, or GMT) time.The now() function of the Date object returns the number of milliseconds since 1st Jan 1970.SyntaxIts syntax is as followsDate.now();Example Live Demo    JavaScript Example       ... Read More

DataView.setUint32() function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 10:22:03

72 Views

The setUint32() function of the DataView stores an unsigned 32-bit integer at the specified position.SyntaxIts syntax is as followsdataView.setUint32();Example Live Demo    JavaScript Example           var arrayBuffer = new ArrayBuffer(20);       var dataView = new DataView(arrayBuffer);       dataView.setUint32(1, 45544);       document.write(dataView.getUint32(1));     Output45544ExampleTo this function you cannot pass float value, if you try to do so it is considered as integer value. Live Demo    JavaScript Example           var arrayBuffer = new ArrayBuffer(20);       var dataView = new ... Read More

DataView.setUint16() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 10:22:51

94 Views

The setUint16() function of the DataView stores an unsigned 16-bit integer at the specified position.SyntaxIts syntax is as followsdataView.setUint16();Example Live Demo    JavaScript Example           var arrayBuffer = new ArrayBuffer(20);       var dataView = new DataView(arrayBuffer);       dataView.setUint16(1, 45544);       document.write(dataView.getUint16(1));     Output45544ExampleTo this function you cannot pass float value, if you try to do so it is considered as integer value. Live Demo    JavaScript Example           var arrayBuffer = new ArrayBuffer(20);       var dataView = new ... Read More

Advertisements