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. Go to the editor]
1. Validate Boolean
Write a JavaScript function to validate whether a given value type is boolean or not.
2. Validate Error
Write a JavaScript function to validate whether a given value type is an error or not.
3. Validate NaN
Write a JavaScript function to validate whether a given value type is NaN or not.
4. Validate Null
Write a JavaScript function to validate whether a given value type is null or not.
5. Validate Number
Write a JavaScript function to validate whether a given value is a number or not.
6. Validate Object
Write a JavaScript function to validate whether a given value is an object or not.
7. Validate Pure JSON Object
Write a JavaScript function to validate whether a given value type is a pure JSON object or not.
8. Validate RegExp
Write a JavaScript function to validate whether a given value is RegExp or not.
9. Validate Char
Write a JavaScript function to validate whether a given value type is char or not.
10. Check Value Equality
Write a JavaScript function to check whether the given values are the same or not.
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.
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://www.w3resource.com/javascript-exercises/validation/index.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics