Term
Definition
const (JS)
For variables you can’t reassign after setting them, use this for most things.
let (JS)
For variables you can reassign when needed.
var (JS)
The old way with weird scoping, avoid using it.
Strings (JS)
Text in quotes.
Numbers (JS)
Can be whole numbers or decimals.
Booleans (JS)
True or false values.
Arrays (JS)
Ordered collections in square brackets that hold multiple items.
Objects (JS)
Key-value pairs in curly braces where you access values by their property name.
Function Declaration (JS)
Uses the function keyword followed by the function name.
Arrow Function (JS)
Uses arrow notation which is the shorter modern syntax. Modern Lambda functions use arrow functions.
async/await (JS)
Used for operations that take time like API calls or database queries. Makes asynchronous code read like synchronous code so it’s easier to understand. Use await to pause execution until a promise resolves. Handler function must be declared as async to use await inside it.
Error Handling (JS)
Wrap risky code in try/catch blocks to handle errors gracefully. Catch errors from await operations so they don’t crash your function. Log errors and return default values so the call flow can continue.
forEach (JS)
Loop through arrays to execute code for each item.
map (JS)
Transform each item into something new.
filter (JS)
Keep only items that match a condition.
find (JS)
Get the first item that matches.
Object Property Access (JS)
Access properties using dot notation or square brackets.
Destructuring (JS)
Extract multiple values into individual variables in one line.
Object Add/Update (JS)
Add or update properties by assigning a value to a property name.
AWS SDK (JS)
Initialize services using new AWS followed by the service name. Call methods and add dot promise at the end to get a promise. Use await to pause until the promise resolves and get the result.
Lambda Structure (JS)
Entry point is exports dot handler equals async function with event and context parameters. Extract input data from the event object that Amazon Connect passes in. Wrap logic in try/catch blocks for error handling. Return an object so Amazon Connect can use the values as contact attributes.
Prototype (JS)
JavaScript’s inheritance system where objects inherit properties and methods from parent objects.
Hoisting (JS)
JavaScript automatically moves variable and function declarations to the top of their scope.