CodeNewbie Community

Discussion on: February 11th, 2021: What did you learn this week?

r002 profile image
Robert Lin

Three newbie lessons I learned this week (in Javascriptlandia):

  1. .sort(...) sorts alphabetically! (Even on numbers!) So to sort an array of numbers in JS, you've gotta do this.

  2. I've been tirelessly working on my personal hobby blogging app and have been having fun with building my custom editor. Apparently I've been living under a rock all these years though; literally only learned about contenteditable this past week. So cool.

  3. Finally, I think this is a bit tough for newbies, but understanding this is seriously so important if you're working in JavaScript. In general, as I've gotten older, I've simply made it a general personal rule (a more "functional" approach, is the parlance) to never mutate (ie. change) arguments that I pass into my functions. But if you must, be sure to understand how it all works in JS-land. (You'll literally find SO and Reddit articles discussing this topic dating back to the beginning of time.)

Many helpful articles abound on the interwebs, but I liked this one.

Hope everyone had a most wonderful week! The learning never stops! ๐Ÿ˜€๐ŸŽ†๐Ÿ˜„๐Ÿš€

nickytonline profile image
Nick Taylor Author

Captain America saluting

r002 profile image
Robert Lin • Edited on

Thanks, Nick! Btw, one burning question I had about the Forem editor... on the main editor where people write articles, I noticed that you guys don't support keyboard shortcuts (eg. <ctrl+b> to bold and <ctrl+i> to italicize, etc). But here in the comment editor, shortcuts are supported! ๐Ÿคจ

Is this a deliberate design decision by the Forem devs to purposefully nerf the Forem editor to encourage people to write shorter articles? If so, I totally understand (makes sense to encourage bite-sized chunks of consumable content versus people writing Homeric odysseys). But if not, I'm actually really tempted to make a PR for keyboard shortcuts in the main article editor. ๐Ÿš€

Thanks for clarifying! ๐Ÿ™๐Ÿ™๐Ÿ™