React Flashcards

1
Q

Arrow function

A

Basic function:
const add = (a, b) => a + b;

With block body:
const multiply = (a, b) => {
return a * b;
};

Anonymous (inline):
[1, 2, 3].map(n => n * 2);

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

Exports

A

default (unnamed):
export default …;

named:
export const someData = …;

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

Imports

A

Default (unnamed):
import upToYou from ‘./path/file.js’

Named:
import {someData} from ‘./path/file.js’

All named:
import * as upToYou from ‘./path/file.js’

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