# ERRORs IN JS


1. 
![carbon (1).png](https://cdn.hashnode.com/res/hashnode/image/upload/v1621335672600/GBib-t2Dv.png)
Output: **Reference error**. As age not found.


2.
 
- `map()` is used when we want to output in terms array. **return** is used.
- `forEach()` is used when we want output line by line. **console.log()** is used.

3.

- 
![carbon (2).png](https://cdn.hashnode.com/res/hashnode/image/upload/v1621336827919/yqKmDuIyY.png)

This will give `Undefined`Output.
As the return is used in a forEach callback function.


- 

The correct way of writing the above code is

![carbon (3).png](https://cdn.hashnode.com/res/hashnode/image/upload/v1621337099342/2aoJKiig-Z.png)
`Console.log` is used instead of **return**. 

-

  If inside callback function argument is not passed. It will give `REFERENCE ERROR` as 
   value not found.

4.
 
-
   
   **Run Time Error**
   if matrix[]3x3 is there and we do console.log(arr[2][4]). It will give `Exception error 
    Out of bound spaces` as this memory is not allocated.

