JavaScript is a programming language that conforms to the ECMAScript specification. It is high-level, often just-in-time compiled, and multi-paradigm with curly-bracket syntax, dynamic typing, prototype-based object-orientation, and first-class functions. A JavaScript function is a block of code that can be executed when called, such as when a user clicks a button on a webpage. Scripts written in JavaScript can be placed in the head or body section of an HTML document or both.