javascript:- nderstanding-the-difference-between-pure-and-impure-functions-in-javascript/ pure function:- that does not change outside value of the function 1: function geek(value) { return value+100; } console.log(geek(34)); 2: function capitalize(str) { return str.toUpperCase(); } console.log(capitalize('geeks')); ............................. lamda function[anonymous function] doesnt have name Lambda functions are pure functions in Javascript. let multiply = (a, b) => a * b; console.log(multiply(5, 9)); const Names = [ 'Mansi', 'Gaurav', 'Akansha', 'Sanya' ]; console.log(Names.map(Names => Names.length)); array.slice[parts the array] gives array returns The slice() method returns selected elements in an array, as a new array. The slice() method selects from a given start, up to a (not inclusive) given end. The slice() method does not change the origi...
Comments
Post a Comment