It's that time of the week folks. So wonderful code newbies, what did you learn this week? It could be programming tips, career advice etc.
Feel free to comment with what you learnt and/or reference your TIL post to give it some more exposure. πππ»ππΌππ½ππΎππΏ
Top comments (3)
Three newbie lessons I learned this week (in Javascriptlandia):
.sort(...)
sorts alphabetically! (Even on numbers!) So to sort an array of numbers in JS, you've gotta do this.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.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! ππππ
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! πππ