From time to time I google for the right syntax how to process lists and dictionaries in Python or arrays and objects in JavaScript. So I decide...
For further actions, you may consider blocking this person and/or reporting abuse
Great post! Just a side note regarding dictionary merging.
In python 3.5 or greater you can merge dictionaries by doing this:
Kind of like a spread operator.
For python 3.4 and below a simpler solution would look like this:
(The copy is only there to prevent mutation of the original dictionaries, but if you are fine with the mutation, you can skip that step and just update a with b)
Great post. You can also use a list comprehension instead of the map or the filter in python. It's a little bit cleaner imo!
I use list comprehensions quite often and much more often than map or filter. But in this article I was trying to find the closest equivalents of Python and JavaScript. As far as I know, there are no list comprehensions in JavaScript..
Oh wait. There are! developer.mozilla.org/en-US/docs/W...
But unfortunately, they are not supported by any modern browser.
OK, I understand 😉
I didn't know either about these javascript functions ! Hope we can really use them one day !
Another way!