Posts

Showing posts from April, 2020

Functions type #1

const sum1 =sum(1,2); sum(a,b){ const sum= a+b; }

tutorials

https://youtu.be/i5-EUAIcxLA ....for E2E testing testcafe javascript https://youtu.be/2foHDNkVkFA ..... For Pom model using testcafe javascript https://youtu.be/PkZNo7MFNFg ..... For JavaScript for beginners

Function stored in a variable

Ok I am I am here to talk about anonymous function in JavaScript, what does that mean, it means that you can access  function without using its name. Syntax to creat anonymous function: var variablename= function(1,2){return a*b};  //returns 5 var a=variablename(1,2); Console.log(a);//prints 5 in console. More details below: Function expression has been stored in a variable the variable can be used as a function. function above is actually an anonymous function, function without a name. functions stored in a variable do not need function names they are always invoked  or  called using variable name.the function above ends with a semicolon because it is part of an executable statement.