
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
AmitDiwan has Published 10744 Articles

AmitDiwan
408 Views
For this, use preventDefault() in JavaScript. Following is the JavaScript code −Example Live Demo Document Press Me to see logs Press Me to see logs in console Nothing will happen $(function(){ $("a:not([href='#'])").click(function(event){ event.preventDefault(); ... Read More

AmitDiwan
207 Views
The Unicode property escapes regular expressions, allow us to match characters based on their Unicode properties by using the flag u.ExampleFollowing is an example − Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .sample, .result ... Read More

AmitDiwan
6K+ Views
The rest operator (…) allows us to call a function with any number of arguments and then access those excess arguments as an array. The rest operator also allows us in destructuring array or objects.The spread operator (…) allows us to expand an iterable like array into its individual elements.ExampleFollowing ... Read More

AmitDiwan
128 Views
To add options to a , you need to use append(). Following is the JavaScript code −Example Live Demo Document Book TV var mySelection = new Option("Mobile", "Samsung Mobile"); $(mySelection).html("Samsung Mobile"); $("#selectCategory").append(mySelection); To ... Read More

AmitDiwan
14K+ Views
In order to disable future dates, you need to use maxDate and set the current date. Following is the JavaScript code −Example Live Demo Document The selected date is as follows: $(document).ready(function () { var currentDate ... Read More

AmitDiwan
325 Views
For this, you need to use keyDown as well as preventDefault(). Following is the JavaScript code −Example Live Demo Document const pressEnter = (event) => { if (event.key === "Enter") { event.preventDefault(); ... Read More

AmitDiwan
3K+ Views
For this, you need to use attr(). The attr() method can be used to either fetch the value of an attribute from the first element in the matched set or set attribute values onto all matched elements.Following is the JavaScript code −Example Live Demo ... Read More

AmitDiwan
270 Views
Precondition to check if the list passed as parameter is empty or not. Let us see an example −Examplepublic void my_fun(List myList){ if (myList == null){ throw new IllegalArgumentException("List is null"); } if (myList.isEmpty()){ throw new IllegalArgumentException("List is empty"); } ... Read More

AmitDiwan
362 Views
Example Live Demopublic class Main{ static volatile boolean exit = false; public static void main(String[] args){ System.out.println("Starting the main thread"); new Thread(){ public void run(){ System.out.println("Starting the inner thread"); ... Read More

AmitDiwan
116 Views
Joiner provides various methods to handle joining operations on string, objects, etc. Let us see an example −Exampleimport com.google.common.base.Joiner; import java.util.*; public class Demo{ public static void main(String[] args){ String[] my_arr = { "hel", null, "lo", "wo", "r", null, "ld" }; System.out.println("The original ... Read More