|
|
|
|
|
by bzbarsky
4152 days ago
|
|
You can destructure objects as well. So: const description = (nameAndOccupation) => {
const { name: { first, last }, occupation } = nameAndOccupation;
return `${first} is a ${occupation}`;
}
description({ name: { first: "Reginald", last: "Brathwaite" }, occupation: "programmer" });
And this last _is_ in fact how real-world code would pass person data around. Your i18n points stand, of course. |
|