OUTPUT:
 

 

CODE:

 

 

Compiled JavaScript code: