JS, method behind the madness. Daniel Dennis on September 08, 2020 Hi There, Welcome to my first Post ☄ It all started with this meme A friend of mine called me out as a now lover of JS. To be honest, ... Read full post Collapse Expand pentacular pentacular pentacular Follow Joined Jul 8, 2020 • Sep 9 '20 Dropdown menu Copy link Hide I think your example code is a bit off const array = [6,-2,2,-7]; array.sort((a,b)=>{ a-b; }); Enter fullscreen mode Exit fullscreen mode The arrow function you've supplied here always returns undefined. I think you intended to write this instead: const array = [6,-2,2,-7]; array.sort((a, b) => a - b); Enter fullscreen mode Exit fullscreen mode The moral of this story is to always test your examples. :) Collapse Expand stefanovualto stefanovualto stefanovualto Follow Joined Feb 5, 2018 • Sep 11 '20 Dropdown menu Copy link Hide Same with that one ;) (missing the return): const array = [6,-2,2,-7]; array.sort(function(a,b){ a-b; }); to work it should be: const array = [6,-2,2,-7]; array.sort(function(a,b){ return a-b; }); Collapse Expand Daniel Dennis Daniel Dennis Daniel Dennis Follow Just another developer. On normal days I use Javascript, on my birthday, I use Typescript Location Nairobi Work Full stack developer Joined Jun 4, 2019 • Sep 9 '20 Dropdown menu Copy link Hide Haha, Oh my God. I completely missed that. Thanks for the heads up Collapse Expand AlanNato AlanNato AlanNato Follow Joined Sep 8, 2020 • Sep 8 '20 Dropdown menu Copy link Hide Before the world ends. I hope I'll write a Hello 👋 World in Js. Collapse Expand Daniel Dennis Daniel Dennis Daniel Dennis Follow Just another developer. On normal days I use Javascript, on my birthday, I use Typescript Location Nairobi Work Full stack developer Joined Jun 4, 2019 • Sep 9 '20 Dropdown menu Copy link Hide You really should, pretty neat language when you learn it. Collapse Expand Anarchy Anarchy Anarchy Follow Constant rants on cool and cutting edge tech. Always ready to learn. Who do I show my Creative Design Sketchpad... Location Nairobi,Kenya Education Undergrad Electrical engineering Work Intermediate Backend Dev at Self Joined Mar 23, 2021 • Mar 23 '21 Dropdown menu Copy link Hide Said the C #eron... Collapse Expand Saber Hosney Saber Hosney Saber Hosney Follow Hey, I'm Saber (not a sword tho :") Basically a web developer. currently I'm enrolled in academic ComputerScience degree, I also Passed the 10,000 hours rule !! finally C++ Sucks just admit it . Location Cairo, Egypt Work Senior software engineer at Shortcut Joined Jan 1, 2020 • Sep 9 '20 Dropdown menu Copy link Hide Are you sure microsoft didn't "sponsor" this article to increase awareness of Typescript 〜( ̄▽ ̄〜) Collapse Expand Daniel Dennis Daniel Dennis Daniel Dennis Follow Just another developer. On normal days I use Javascript, on my birthday, I use Typescript Location Nairobi Work Full stack developer Joined Jun 4, 2019 • Sep 9 '20 Dropdown menu Copy link Hide Yikes, They skipped Florin Pop and came to me for a promotional Blog. Collapse Expand Galuh Utama Galuh Utama Galuh Utama Follow Haven’t used new, delete, malloc and free since 2013. Location Germany Education Brandenburg University of Applied Sciences Joined May 11, 2020 • Sep 8 '20 Dropdown menu Copy link Hide Ah JavaScript. A jungle of landmines. There’s even a pitfall when it’s used for sorting numbers. Collapse Expand Billy Okeyo Billy Okeyo Billy Okeyo Follow I am a software engineer building products in Python(Django), Flutter, JavaScript, TypeScript(Angular) and .NET. Location Nairobi Work Software Engineer at Innova Limited Joined Apr 8, 2020 • Sep 8 '20 Dropdown menu Copy link Hide Some good insights on that. I love your conclusion Collapse Expand Daniel Dennis Daniel Dennis Daniel Dennis Follow Just another developer. On normal days I use Javascript, on my birthday, I use Typescript Location Nairobi Work Full stack developer Joined Jun 4, 2019 • Sep 8 '20 Dropdown menu Copy link Hide Thank you So much for the feedback Collapse Expand TILLERN TILLERN TILLERN Follow Location Kenya Work Software developer Joined Sep 8, 2020 • Sep 8 '20 • Edited on Sep 8 • Edited Dropdown menu Copy link Hide Javascript is just awesome Collapse Expand AGiesey AGiesey AGiesey Follow Hi, I'm Adam. I love to create web applications and learn new things Location Ann Arbor, MI Education B.S. Web Design, M.S. Software Engineering Work Software Engineer at Midwestern Software Solutions Joined Sep 9, 2020 • Sep 9 '20 Dropdown menu Copy link Hide Thanks for the article! JS has some weird gotchyas and it's nice to be reminded of specific examples. Collapse Expand Daniel Dennis Daniel Dennis Daniel Dennis Follow Just another developer. On normal days I use Javascript, on my birthday, I use Typescript Location Nairobi Work Full stack developer Joined Jun 4, 2019 • Sep 9 '20 Dropdown menu Copy link Hide You are welcome ! I hope you learned a thing or 2 Collapse Expand Daniel Dennis Daniel Dennis Daniel Dennis Follow Just another developer. On normal days I use Javascript, on my birthday, I use Typescript Location Nairobi Work Full stack developer Joined Jun 4, 2019 • Sep 9 '20 Dropdown menu Copy link Hide Thank you Mary Anna. We love JS regardless Code of Conduct • Report abuse For further actions, you may consider blocking this person and/or reporting abuse
I think your example code is a bit off
The arrow function you've supplied here always returns undefined.
I think you intended to write this instead:
The moral of this story is to always test your examples. :)
Same with that one ;) (missing the
return
):to work it should be:
Haha, Oh my God. I completely missed that. Thanks for the heads up
Before the world ends.
I hope I'll write a Hello 👋 World in Js.
You really should, pretty neat language when you learn it.
Said the C #eron...
Are you sure microsoft didn't "sponsor" this article to increase awareness of Typescript
〜( ̄▽ ̄〜)
Yikes, They skipped Florin Pop and came to me for a promotional Blog.
Ah JavaScript. A jungle of landmines. There’s even a pitfall when it’s used for sorting numbers.
Some good insights on that. I love your conclusion
Thank you So much for the feedback
Javascript is just awesome
Thanks for the article! JS has some weird gotchyas and it's nice to be reminded of specific examples.
You are welcome ! I hope you learned a thing or 2
Thank you Mary Anna. We love JS regardless