Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
lwc:programming:javascript [2025/03/18 13:50] John Harrisonlwc:programming:javascript [2025/03/18 13:58] (current) John Harrison
Line 54: Line 54:
  
 ==== Promises ==== ==== Promises ====
-Promises are always async and often used to prevent UI blocking when waiting for something like an I/O interface+Promises are always async and often used to prevent UI blocking when waiting for something like an I/O interface. If a function has a ''.then'' then it is definitely calling a promise (or a "thenable" object but yeah that doesn't happen)
 === Creating the promise (producing) === === Creating the promise (producing) ===
 <code> <code>
Line 83: Line 83:
 ^ Category ^ Old Skool       ^ Arrow Function          ^ ^ Category ^ Old Skool       ^ Arrow Function          ^
 | No Parameter    | function fred() = {}     | () => {}       | | No Parameter    | function fred() = {}     | () => {}       |
-| One Parameter   | function fred(a) = {} | (a) => {} |+| One Parameter   | function fred(a) = {} | (a) => {} or a => {} (parens are optional when only 1 argument)|
 | Two Parameters  | function fred(a,b) = {}     | (a,b) => {}        | | Two Parameters  | function fred(a,b) = {}     | (a,b) => {}        |
  • lwc/programming/javascript.1742323814.txt.gz
  • Last modified: 2025/03/18 13:50
  • by John Harrison