JavaScript Validation - Exercises, Practice, Solution
JavaScript validation [10 exercises with solution]
[An editor is available at the bottom of the page to write and execute the scripts.]
1. Write a JavaScript function to validate whether a given value type is boolean or not. Go to the editor
2. Write a JavaScript function to validate whether a given value type is error or not. Go to the editor
3. Write a JavaScript function to validate whether a given value type is NaN or not. Go to the editor
4. Write a JavaScript function to validate whether a given value type is null or not. Go to the editor
5. Write a JavaScript function to validate whether a given value is number or not. Go to the editor
6. Write a JavaScript function to validate whether a given value is object or not. Go to the editor
7. Write a JavaScript function to validate whether a given value type is pure json object or not. Go to the editor
8. Write a JavaScript function to validate whether a given value is RegExp or not. Go to the editor
9. Write a JavaScript function to validate whether a given value type is char or not. Go to the editor
10. Write a JavaScript function to check whether given value types are same or not. Go to the editor
More to Come !
* To run the code mouse over on Result panel and click on 'RERUN' button.*
Live Demo:
See the Pen javascript-common-editor by w3resource (@w3resource) on CodePen.
Do not submit any solution of the above exercises at here, if you want to contribute go to the appropriate exercise page.
JavaScript: Tips of the Day
Shorten an array using its length property
A great way of shortening an array is by redefining its length property.
let array = [0, 1, 2, 3, 4, 5, 6, 6, 8, 9] array.length = 4 // Result: [0, 1, 2, 3]
Important to know though is that this is a destructive way of changing the array. This means you lose all the other values that used to be in the array.
Ref: https://bit.ly/2LBj213
- Weekly Trends
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
- JavaScript functions Exercises
- Python Tutorial
- Python Array Exercises
- SQL Cross Join
- C# Sharp Array Exercises