Created
December 14, 2021 05:36
-
-
Save peterdresslar/216996e43342e8de09ba5c038e2b3f4d to your computer and use it in GitHub Desktop.
example fix #16 angband-webclient
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 data= ["pos","angband","frog","alex"]; | |
var angband = 'angband'; | |
data.sort(); | |
if (data.some(e => e === angband)) { | |
/* data contains angband */ | |
data.sort(function(x,y){ return x == angband ? -1 : y == angband ? 1 : 0; }); | |
} | |
console.log(data); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment