0
比較的新しいJSです。配列の配列を取り、その列を配列に変換するこのコードを理解しようとしています。Javascript - 列を列に変換する
grid=
[[".",".",".","1","4",".",".","2","."],
[".",".","6",".",".",".",".",".","."],
[".",".",".",".",".",".",".",".","."],
[".",".","1",".",".",".",".",".","."],
[".","6","7",".",".",".",".",".","9"],
[".",".",".",".",".",".","8","1","."],
[".","3",".",".",".",".",".",".","6"],
[".",".",".",".",".","7",".",".","."],
[".",".",".","5",".",".",".","7","."]]
//Turn columns into rows
var transpose = grid =>
grid[0].map(
(_,c) => grid.map(
row => row[c]
)
)
これは通常の機能を使ってどのように見えますか?
あなたは「通常の」機能とはどういう意味ですか? – Xufox
結果として必要なものについての説明を追加します。 –
"for"ループを使用していますか? –