Last active
December 25, 2024 11:24
-
-
Save ksk1015/e563ebb42fd0fc12e8f11d08a6db9046 to your computer and use it in GitHub Desktop.
kayacのやってるJS体操、早く良い感じにできたやつ
This file contains hidden or 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
| // https://hubspot.kayac.com/js-taiso-004 | |
| // 119 | |
| // export default s=>'くしつのへいうこてとひめりるろんあえかけさすせそちにみもやゆよられわおきたぬねはふまむをなほ'.replace(/./g,c=>s.replace(RegExp(`[^${c}]`,'g'),'')) | |
| // 117 | |
| // export default s=>[...'くしつのへいうこてとひめりるろんあえかけさすせそちにみもやゆよられわおきたぬねはふまむをなほ'].reduce((a,c)=>a+[...s.matchAll(c)].join``,'') | |
| // 118 | |
| // export default s=>[...s].sort((a,b,f=c=>'しつのへいうこてとひめりるろんあえかけさすせそちにみもやゆよられわおきたぬねはふまむをなほ'.indexOf(c))=>f(a)-f(b)).join`` | |
| // 112 | |
| // export default s=>[...'くしつのへいうこてとひめりるろんあえかけさすせそちにみもやゆよられわおきたぬねはふまむをなほ'].map(c=>[...s.matchAll(c)].join``).join`` | |
| // 109 | |
| // export default s=>'くしつのへいうこてとひめりるろんあえかけさすせそちにみもやゆよられわおきたぬねはふまむをなほ'.replace(/./g,c=>[...s.matchAll(c)].join``) | |
| export default s=>'くしつのへいうこてとひめりるろんあえかけさすせそちにみもやゆよられわおきたぬねはふまむをなほ'.replace(/./g,c=>[...s.matchAll(c)].join``) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment