2次元配列を1次元配列に変換する方法

Yuki Usuzaki 1 Reputation point
2022-09-17T08:14:50.23+00:00

office Excelで、セル範囲の値を取得した場合、2次元配列で取得されますが、
それを1次元配列に変換したいです。
flat関数を使用すると、logでは1次配列になっておりますが、
エラーに「Property 'flat' does not exist on type '(string | number | boolean)[][]'.」と記載されます。
なぜでしょうか?
flat関数は使用できないのでしょうか?
使用できない場合、1次配列に変換するにはどのようにすれば良いでしょうか?

Microsoft 365 and Office | Development | Other
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.