JavaScript string methods | Code
As you know a JavaScript string is an object that represents a sequence of characters. JavaScript strings have methods and properties because JavaScript treats primitive… Read More »JavaScript string methods | Code
JavaScript Tutorials
As you know a JavaScript string is an object that represents a sequence of characters. JavaScript strings have methods and properties because JavaScript treats primitive… Read More »JavaScript string methods | Code
JavaScript primitives data types like string, number, and boolean are immutable by default, they cannot be altered. But JavaScript objects and arrays are not immutable… Read More »JavaScript immutable arrays | Example code
Use OR (||) operator in the if statement expression to get if or multiple conditions in JavaScript. In expression, if any of the conditions is… Read More »JavaScript if or multiple conditions
Use JavaScript’s window.open() method to open the popup window in JavaScript. Popup windows are different from simply opening a new browser window. JavaScript opens a… Read More »JavaScript open popup window
JavaScript enumerable property is one that can be included in and visited during for..in loops (or a similar iteration of properties, like Object.keys()). If a… Read More »JavaScript enumerable | Property
You can use the replace() method with the regex in JavaScript to remove spaces from the string. Or use The trim() method to remove whitespace… Read More »Remove spaces from string JavaScript
JavaScript Document open() method opens a document for writing. The difference between open() and write() is that open() clears the document so you can write… Read More »JavaScript document open | Method
To get the last N or 4 characters of a string, use the slice method on the string in JavaScript. You have to pass the… Read More »Get last 4 characters of string JavaScript | Example code
JavaScript document write() function writes to the document stream, calling document.write on a closed (loaded) document automatically calls document.open, which will clear the document. In… Read More »What does document write function do
Use the navigator userAgent property to detect User Agent in JavaScript. You have to match the browser name to identify the user browser. User Agent… Read More »User Agent JavaScript detection | Code