Last active
March 22, 2018 02:52
-
-
Save kobaatsu/95891f636b5a968d674dc05843d08d37 to your computer and use it in GitHub Desktop.
[objectをソートしてイテレーション]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- var menu = [{order:20, label:'foo'},{order:10, label:'bar'}] | |
- menu.sort((a,b)=>{return a.order > b.order ? 1 : -1}) | |
each m in menu | |
li= m.label |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment