CSE 130- Final Exam Guide - Comprehensive Notes for the exam ( 66 pages long!)

121 views66 pages

Document Summary

You can learn any languages once you have a grasp of fundamentals and features. Can be passed as arguments to another function. Function-level scoping: curly braces does not necessarily mean a new scope! New: use const or let console. log( a: x = "); //42 var x = 45; console. log( b: x = "); Just syntactic sugar () => //same thing as function()! Synchronous functions blocks other functions until they are done! function cb1(err, str) { } function cb2(err,str) { } If we finish reading the second file before the first file, then cb2 can be executed first! Ex: (f o g)(x) = f (g(x)) console. log(map(map(list, add42), mul1337)); console. log(map(list, compose(mul1337, add42))); function compose(f, g) { But the functions in js may pass the state ! Closure = function code + environment const h = f(5); console. log(h(3)); console. log(h(4)); const j = f(5); console. log(j(3)); //creates a new closure with its own scope!! Locally declared vars are scoped to the function ( module )

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents