chhotii: (diploma)
[personal profile] chhotii
Explain this:


a = [3,5,3,2,1,6,7,9,4,0,7,6,5,4,3]
(15) [3, 5, 3, 2, 1, 6, 7, 9, 4, 0, 7, 6, 5, 4, 3]
a.sort( (a,b) => { a-b } );
(15) [3, 5, 3, 2, 1, 6, 7, 9, 4, 0, 7, 6, 5, 4, 3]
a.sort( (a,b) => { a-b; } );
(15) [3, 5, 3, 2, 1, 6, 7, 9, 4, 0, 7, 6, 5, 4, 3]
a.sort( (a,b) => a-b );
(15) [0, 1, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 9]



Why, JavaScript, why. I hate you, JavaScript. Grrrr.

Date: 2020-05-08 06:26 pm (UTC)
totient: (Default)
From: [personal profile] totient
I already hated JavaScript and this abuse of lambdas is not changing my opinion any.

Profile

chhotii: (Default)
chhotii

July 2023

S M T W T F S
      1
2345678
9101112131415
16 171819202122
23 242526272829
3031     

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 26th, 2026 06:38 pm
Powered by Dreamwidth Studios