Projects references to the "Error Handling Javascript" course of Bootcamp TQI Fullstack Developer - DIO.
The goal is for the function to receive an array and return it if its size matches the number sent as a parameter in the function. Otherwise, an error will be thrown.
- Create a function that takes an array and a number.
- Perform the following validations:
- If the parameters are not sent, throw an error of type ReferenceError.
- If the array is not of type 'object', throw an error of type TypeError.
- If the number is not of type 'number', throw an error of type TypeError.
- If the array size is different from the number sent as a parameter, throw an error like RangeError.
- Use the try...catch statement
- Filter catch calls by each type of error using the operator instanceof
- JavaScript : is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS.
- Node : As an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications.
- VS Code : is a source-code editor made by Microsoft for Windows.
For download the source code of project in yout PC, firstly you must have install in your PC the GIT .
With the Git installed, in your terminal execute the following command:
$ git clone https://github.com/jonasmachados/error-handling-javascript
Install NodeJS 16.x
https://nodejs.org/en/download/
Install VS Code
https://code.visualstudio.com/download
Jonas Machado