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);
2
Q
Exports
A
default (unnamed):
export default …;
named:
export const someData = …;
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’