javascript_flashcards

(39 cards)

1
Q

Term

A

Definition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

const (JS)

A

For variables you can’t reassign after setting them, use this for most things.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

let (JS)

A

For variables you can reassign when needed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

var (JS)

A

The old way with weird scoping, avoid using it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Strings (JS)

A

Text in quotes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Numbers (JS)

A

Can be whole numbers or decimals.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Booleans (JS)

A

True or false values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Arrays (JS)

A

Ordered collections in square brackets that hold multiple items.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Objects (JS)

A

Key-value pairs in curly braces where you access values by their property name.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Function Declaration (JS)

A

Uses the function keyword followed by the function name.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Arrow Function (JS)

A

Uses arrow notation which is the shorter modern syntax. Modern Lambda functions use arrow functions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

async/await (JS)

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Error Handling (JS)

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

forEach (JS)

A

Loop through arrays to execute code for each item.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

map (JS)

A

Transform each item into something new.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

filter (JS)

A

Keep only items that match a condition.

17
Q

find (JS)

A

Get the first item that matches.

18
Q

Object Property Access (JS)

A

Access properties using dot notation or square brackets.

19
Q

Destructuring (JS)

A

Extract multiple values into individual variables in one line.

20
Q

Object Add/Update (JS)

A

Add or update properties by assigning a value to a property name.

21
Q

AWS SDK (JS)

A

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.

22
Q

Lambda Structure (JS)

A

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.

23
Q

Prototype (JS)

A

JavaScript’s inheritance system where objects inherit properties and methods from parent objects.

24
Q

Hoisting (JS)

A

JavaScript automatically moves variable and function declarations to the top of their scope.

25
Scope (JS)
Where variables are accessible in your code. Can be global everywhere, function level inside functions, or block level inside curly braces.
26
Closure (JS)
Function that remembers variables from its outer scope even after the outer function finishes.
27
Callback (JS)
Function passed as an argument to another function that gets called later.
28
Promise (JS)
Object representing eventual completion of async operation. Has three states: pending, fulfilled, or rejected.
29
Spread Operator (JS)
Expands an array or object using three dots. Combines arrays or objects together.
30
Template Literal (JS)
String that lets you embed expressions inside it using backticks. Easier than concatenating strings together.
31
Truthy and Falsy (JS)
Values that evaluate to true or false in conditions. Falsy values are zero, empty string, null, and undefined. Everything else is truthy.
32
null (JS)
Intentionally empty value you explicitly set to indicate nothing.
33
this Keyword (JS)
Refers to the object that's currently executing the function.
34
undefined (JS)
Variable has been declared but hasn't been assigned a value yet.
35
Double Equals vs Triple Equals (JS)
Double equals converts types before comparing. Triple equals checks both type and value. Always use triple equals to avoid bugs.
36
Map (JS)
Key-value pairs where keys can be any type, not just strings like regular objects.
37
Array Methods (JS)
Built-in functions for working with arrays. map transforms each item, filter keeps items that match a condition, reduce combines all items into one value, find gets the first matching item, forEach loops through all items.
38
JSON.parse (JS)
Converts a JSON string into a JavaScript object.
39
JSON.stringify (JS)
Converts a JavaScript object into a JSON string.