2022年8月14日GASsort,配列 sortメソッドの用いた一次元配列、二次元配列の並び替え記述方法を目的別にご紹介します。 本記事で紹介している記述の裏側の仕様やsortメソッドについての詳細は下記の記事で解説しています。 一次元配列の並び替え 文字列の昇順(デフォルト) let animal = let animal = ['dog', 'tiger', 'elephant', 'cat', 'lion', 'monkey']; console.log(animal.sort()); //[ 'cat', 'dog', 'elephant', 'lion', 'monkey', 'tiger' ] 文字列の降順 let animal = let animal = ['dog', 'tiger', 'elephant', 'cat', 'lion', 'monkey']; /