JavaScript is a functional, object-oriented programming language (Douglas Crockford)…