Posts

Showing posts from August, 2020

Learn Shadowing In JavaScript Day 4

Image
Lecture 4 : Learn Shadowing In JavaScript Shadowing Problem : Shadowing is an informal way for someone to learn what it is like to perform a particular job at a workplace. An individual follows around, or shadow, the worker already in that role. Shadowing is not restricted to individuals who are new to the professional workforce, as it can be an equally useful tool for those in established careers who are looking to pivot to new directions. There are two concepts of Shadowing:                1) Variable Shadowing                2) Function Shadowing Outer variable or function is shadowed by the inner variable or function. Inner variable or function is mask of outer variable or function. Example : Program- <html> <body> <script> function fun() {     var f1 = 10;     alert(f1); } function fun() {     var f2 = 20;     alert(f2); } fun(); </script> </body> </html> Output- IIFE : An immediately involved function express

Data Type Of JavaScript Day 3

Image
Lecture 3 : Data Types Of JavaScript Data Types : Data type variables can hold many data types: string, number, boolean. To be able to operate on variables, it is important to know something about the type. There are three main data types in JavaScript:           1) string           2) number           3) boolean 1) string : A string is a series of characters like "John Doe". String are written with quotes. You can use single or double quotes: Example :       1) var name = "Mayuri"; // using double quotes       2) var name = 'Mahesh'; // using single quotes 2) number : JavaScript has only one type of numbers. Numbers can be written with, or without decimals. Example :       1) var x1 = 34.00 ; // using with decimal       2) var x2 = 34; // using without decimal 3) boolean : Booleans can only have two values: true or false. Booleans are often used in conditional testing. Example :       var x = 5;       var y = 5;       var z = 6;       (x == y) return true  

Concept Of JavaScript Day 2

Image
Lecture 2 : Concept Of JavaScript Var for Declaration : Declaration a variable in JavaScript has always traditionally been done with the for keyword. Declaration: var=10 We just declared a variable named a with the value 10. We can also declare a variable inside of a function:           function f()            {                var message="Hello world!";                return message;            } Global Pollution : If we do not declare variable with var keyword then the variable become global, so anyone can access the variable at any time. Polluting the global means that you can define to many variables that are globally accessible it may leads to generate errors because access is not restricted. Example : Program- <html> <body> <b>This is a first program</b> <script> function f1() {     X=0; } f1(); alert (X); </script> </body> </html> Output- Hoisting : Hoisting is JavaScript's default behaviour of mov

Basic Of JavaScript Day 1

Image
Lecture 1 : Basic Of JavaScript Introduction : JavaScript is a object-oriented , dynamic programming language. JavaScript is a very powerful client-side scripting language. JavaScript is used mainly for enhancing the interaction of a user with the webpage. JavaScript is also being used widely in game development and mobile application development. JavaScript can be run on any operating systems and almost all web browsers. History :  JavaScript was created by  Brendan Eich  in 1995. JavaScript's original name was Mocha. JavaScript has nothing to do with java. Java was famous at that time, hence the name "JavaScript" was chosen, to ride on Java's success. Microsoft created a reverse-engineered version of JavaScript, know as JScript. Example : Program- <html> <body> <b>This is a first Program of JavaScript</b> <script> var x=0; X++; alert(X); var X="Hello"; alert(X); </script> </body> </html> Output-