Skip to content

Instantly share code, notes, and snippets.

@triacontane
Created October 27, 2022 13:42
Show Gist options
  • Save triacontane/6af739dfed5ea6051d2f3daee8d3980b to your computer and use it in GitHub Desktop.
Save triacontane/6af739dfed5ea6051d2f3daee8d3980b to your computer and use it in GitHub Desktop.
配列の昇順チェック
const arr = [4, 6, 7, 9];
const result = arr.every((value, i, self) => i + 1 === self.length || value <= self[i + 1]);
console.log(result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment