Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Programming Scripts Articles - Page 35 of 37
681 Views
In this tutorial, we will learn to check whether a value is a safe integer or not in JavaScript. The simple definition of the safe integer in JavaScript is all numbers we can represent under the IEEE-754 double-precision number. It is the set of all numbers which lie between the -(2^53) to (2^53) exclusive, and we can represent it in the standard way. Here, we have different approaches to checking whether the number is a safe integer. Using the Number.IsSafeInteger() Method Using the if-else Conditional Statement Using the Number.isSafeInteger() Method In JavaScript, the isSafeInteger() method checks that type ... Read More
276 Views
To find a character except for a newline, use the Metacharacter. (period). You can try to run the following code to find a character −Example JavaScript Regular Expression var myStr = "We provide websites! We provide content!"; var reg = /p.o/g; var match = myStr.match(reg); document.write(match);
146 Views
To match an expression, use the JavaScript match() method. This method is used to retrieve the matches when matching a string against a regular expression. The following is the parameter −param − A regular expression object.If the regular expression does not include the g flag, it returns the same result as regexp.exec(string).If the regular expression includes the g flag, the method returns an Array containing all the matches.ExampleYou can try to run the following code to math an expression using JavaScript Regular Expression − JavaScript String match() Method ... Read More
178 Views
The operator is used in JavaScript to check whether a property is in an object or not.ExampleYou can try to run the following code to learn how to use in operator in JavaScript −Live Demo var emp = {name:"Amit", subject:"Java"}; document.write("name" in emp); document.write(""); document.write("subject" in emp); document.write(""); document.write("MAX_VALUE" in Number); document.write(""); document.write("MIN" in Number);
48K+ Views
We will learn how to add a row to a table using JavaScript dom. To achieve this, we have multiple methods. Some of them are the following. Using the insertRow() method By creating the new Element Using the insertRow() Method The inserRow() method is used to insert a new row at the starting of the table. It creates a new element and inserts it into the table. This takes a number as a parameter that specifies the position of the table. If we do not pass any parameter then it inserts the row at the starting of ... Read More
680 Views
To perform multiline matching, use the M modifier available in JavaScript Regular Expression.ExampleYou can try to run the following code to perform multiline matching − JavaScript Regular Expression var myStr = "Welcoming!"; var reg = /^ing/m; var match = myStr.match(reg); document.write(match);
262 Views
To match any of the specified alternatives, follow the below-given pattern −(foo|bar|baz)ExampleYou can try to run the following code to find any alternative text − JavaScript Regular Expression var myStr = "one,one,one, two, three, four, four"; var reg = /(one|two|three)/g; var match = myStr.match(reg); document.write(match);
6K+ Views
To delete rows in a table in JavaScript, use the DOM deleteRow() method.ExampleYou can try to run the following code to learn how to delete rows in a table. The code deletes rows one at a time −Live Demo function captionFunc(x) { document.getElementById(x).createCaption().innerHTML = "Demo Caption"; } One Two Three Four Five Six
10K+ Views
This tutorial will teach us to show image rollover with a mouse event in JavaScript. The meaning of the image rollover is to either change the image style or the whole image when the user rollovers the mouse on the image.To build an attractive user interface, developers often add image rollover features to the website and applications. Here, we will see to apply image rollover differently.Change the style of the image on mouse rolloverIn this method, to create the image rollover, we will use the onmouseover and onmouseout event of JavaScript. When users take the mouse pointer on the image, ... Read More
649 Views
To create a table caption, use the DOM createCaption() method.ExampleYou can try to run the following code to learn how to create table caption −Live Demo function captionFunc(x) { document.getElementById(x).createCaption().innerHTML = "Demo Caption"; } One Two Three Four Five Six