DEV Community

Discussion on: Why do we write JavaScript like this?

 
anders profile image
Anders

without deep knowledge of how python works that is not intuitive for me sadly. Might be time to look at some python stuff to get better insight =)

Thread Thread
 
heyitsarpit profile image
Arpit

That's fine. The only issue is the unfamiliarity with [::-1] or [:n] or [start:end] syntax. This works like Array.slice() for reading lists and strings. It just says you want to capture the list/string between a start and end index. The negative one means read the string backwards.

Thread Thread
 
anders profile image
Anders

Looked it up just now as well, there are certainly some powerful capabilities there, including the stride thing, real nice.

There is a lot of room for ergonomic improvements in JS. But it will forever be hampered by the "compiler" being on the remote system.

Thread Thread
 
johnkazer profile image
John Kazer

From a functional point of view I find that Ramda makes a good case as a standard library. Has a good reverse function as example. But certainly not to everyone's taste I guess.
ramdajs.com/docs/#reverse