JavaScript - Introduction

What is Javascript ?
  • JavaScript is a lightweight, cross-platform, single-threaded, and interpreted compiled programming language. It is also known as the scripting language for webpages. It is well-known for the development of web pages, and many non-browser environments also use it.
  • JavaScript is a weakly typed language (dynamically typed). JavaScript can be used for Client-side developments as well as Server-side developments.
  • JavaScript is both an imperative and declarative type of language. JavaScript contains a standard library of objects, like Array, Date, and Math, and a core set of language elements like operators, control structures, and statements.

    How to Link JavaScript File in HTML ?
    JavaScript can be added to HTML file in two ways:
  • Internal JS : We can add JavaScript directly to our HTML file by writing the code inside the < script> tag. The < script> tag can either be placed inside the < head> or the < body> tag according to the requirement.
  • External JS : We can write JavaScript code in another files having an extension.js and then link this file inside the < head> tag of the HTML file in which we want to add this code.
    < script>
        // JavaScript Code
    < /script>
    
    


    (JS - Tokens, Identifiers and Literals)