top of page
  • Writer's pictureGopal Panday

Core Features and Concepts You Need to know in Modern JavaScript Development

Updated: Apr 19, 2022


As a web developer it is mandatory to learn JavaScript, it signifies the major role in the website building process and it decides the behavior of the web pages that means to process data through forms, the user submits data through the forms and get stored in another backend process, it also works in backend development, so if the user enters incorrect details in the forms it shows the different types of errors in the forms for example if the user enter incorrect email format in email placeholder then it throws the error that you typed incorrect email , please provide the correct one.


Same in password placeholder, if the user enters the incorrect password in confirmation, for example a developer set conditions that user can enter only special characters, numbers, capital letters, these are some parameters on the basis of which the whole mechanism is carry out.


If the JavaScript is not there, so there is no need to learn the web development courses in Rohini, cause the JavaScript is backbone of the web development, every small to big websites are using JavaScript.


Functions of JavaScript.


Below mentions the sample code for showing the function:





Function myfunc (f1, f2) {

Return f1+f2; // the function returns the addition of f1 and f2

}

The JavaScript functions can be declared with the function keyword as shown above ,along with name , and parenthesis ()


Function myfunc (f1, f2) // these are listed as parameters {

Return f1+f2; // the function returns the addition of f1 and f2

}

myfunc (4, 3); // function invoked or called.

the variables act as parameters which are written under the function declaration parenthesis ().

The variables act as arguments when the function is called or when it is invoked.

The parameters in function parenthesis are local variable



<! DOCTYPE html>

<html>

<body>


<h2>JavaScript Functions</h2>


<p>This example calls a function which performs a calculation and returns the result:</p>


<p id="demo"></p>


<script>

my Function (4, 3);

document.getElementById("demo").innerHTML = myFunction(6,5);


function my Function(a, b) {

return a * b;

}

</script>


</body>

</html>


The main core js concepts to look for!!

• Named function

• Anonymous function

• IIFE (Immediately invoked function expression)

• Scope

• Closure

• Callback

• Named functions


Function myfunc (f1, f2) // these are listed as parameters {

Return f1+f2; // the function returns the addition of f1 and f2

}

myfunc (4, 3); // function invoked or called.

• Anonymous function

Let show = function () {

Console.log (“Anonymous function”);

};

Show ();


• IIFE

(function()  

 {  

 console.log ("Hello World");   

})();  


• Scope

It is a term used as box with boundaries, scope is defined into 2 parts, local, global, inner and out, the term local scope is used for inside the function block when variable declared inside the block, whereas the global scope is used as the variable which is defined outside the block, used wherever in the program.

• A closure is a function inside another function, this type of function is used to extend the functionality as pass variables, methods and arrays from an outer function to inner function.

Function showInfo(){

Const empType = ‘ Private’;


// A closure

Function showName(){

Return empType; // access another function

}

Return showName();

}

showInfo();

// Private;


• A callback function executes after another function gets executed, it is also referring to as call-after.

function createQuote(quote, callback){

var myQuote = "Like I always say, " + quote;


For getting more information you can go for JavaScript course in Rohini.






20 views

Recent Posts

See All
bottom of page