What is JavaScript

What is Javascript?

JavaScript (JS) is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions. While it is most well-known as the scripting language for Web pages, many non-browser environments also use it, such as Node.js, Apache CouchDB and Adobe Acrobat. JavaScript is a prototype-based, multi-paradigm, single-threaded, dynamic language, supporting object-oriented, imperative, and declarative (e.g. functional programming) styles.

JavaScript is primarily known as the language of most modern web browsers.

Features of JavaScript

  • All popular web browsers support JavaScript as they provide built-in execution environments.

  • JavaScript follows the syntax and structure of the C programming language. Thus, it is a structured programming language.

  • JavaScript ignores spaces, tabs, and newlines that appear in JavaScript programs.

  • JavaScript is a weakly typed language, where certain types are implicitly cast (depending on the operation).

  • JavaScript is an object-oriented programming language that uses prototypes rather than using classes for inheritance.

  • It is a light-weighted and interpreted language.

  • It is a case-sensitive language.

  • JavaScript is supportable in several operating systems.

  • It provides good control to the users over the web browsers.

Variables :

Variables allow computers to store and manipulate data in a dynamic fashion. They do this by using a “label” to point to the data rather than using the data itself. Any of the eight data types may be stored in a variable.

Variables are similar to the x and y variables you use in mathematics, which means they’re a simple name to represent the data we want to refer to. Computer variables differ from mathematical variables in that they can store different values at different times.

To define a variable in JavaScript, you use var keyword. For example:
var x = 10;
var y = 20;

Taking Input from user:

To take an input string from console and saving it to a variable, we can write:

var a = readLine()

Now, variable a holds a string which is given as input in the console.

Output “Hello, world!”

To output/print string “Hello, word!” on the console, we can write:

console.log("Hello, world!")

Try the following example in the editor below.

Take a user input string and print space separated “Hello” and input (without quotes).

Input

Read a string input.

Output Format

Print Hello input to stdout.

Hope I was able to clear my point if you have still doubt or suggestion then please comment me I will try to reply as soon as possible.