The function and var are known as___

The function and var are known as declarative statements in JavaScript

Generally you may get options to choose from as below

A. Keywords

B. Data types

C. Declaration statements

D. Prototypes

Functions and Variables declare or define variables and functions. These statements define identifiers (variable and function names) that can be used elsewhere in your program and assign values to those identifiers.

Like below example. myFunction is the name of Function , P1 P2 are parameters. carName is a variable which has the value “Volvo”. This can be used for further programming.

function myFunction(p1, p2) {

let carName = “Volvo”;
 return p1 * p2;   // The function returns the product of p1 and p2

….

……

…..
}

The function and var are known as

Declarative Statements

more about computing

Leave a Comment