@Field((type) => [Dish])
@ManyToMany((type) => Dish)
@JoinTable()
dishes: Dish[];
https://typeorm.io/#/many-to-many-relations
https://orkhan.gitbook.io/typeorm/docs/many-to-many-relations
Ex) const newArr = arr.flat([depth])
flat() ๋ฉ์๋๋ ๋ชจ๋ ํ์ ๋ฐฐ์ด ์์๋ฅผ ์ง์ ํ ๊น์ด๊น์ง ์ฌ๊ท์ ์ผ๋ก ์ด์ด๋ถ์ธ ์๋ก์ด ๋ฐฐ์ด์ ์์ฑํ๋ค. depth๋ ์ค์ฒฉ ๋ฐฐ์ด ๊ตฌ์กฐ๋ฅผ ํํํํ ๋ ์ฌ์ฉํ ๊น์ด ๊ฐ์ด๋ฉฐ ๊ธฐ๋ณธ๊ฐ์ 1์ด๋ค.
[ [1], [2], [], [], [5], [6] ].flat()
// [1, 2, 5, 6]
const arr1 = [1, 2, [3, 4]];
arr1.flat();
// [1, 2, 3, 4]
const arr4 = [1, 2, [3, 4, [5, 6, [7, 8, [9, 10]]]]];
arr4.flat(Infinity);
// [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
const arr5 = [1, 2, , 4, 5];
arr5.flat();
// [1, 2, 4, 5]
https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/flat