Being my first post, I want to share something handy but useful, especially if you are in the first steps with Javascript.
I read a lot of posts a...
For further actions, you may consider blocking this person and/or reporting abuse
They really helpful methods indeed. But I'd not throw away libraries like lodash completely, because they have a lot of useful functions.
Btw, the post's cover image with old-style jQuery carousel code is not in sync with the post content - React's mentions and relatively new es2015
Object.assign
,.some
,.every
methods 😀Yes, you are right. I didn't take the time to select the right cover image; I will choose another later.
Regarding Lodash, in my opinion, since nowadays we have ES6 and Babel to compile ES6 in ES5, I think that most of the time, there is no need to sacrifice speed and add complexity using Lodash when you can use pure ES6 functions. But, again, it is just an opinion. Lodash is still very popular and useful in a lot of cases.
Fantastic article, Martín, and I would have to agree with you on ES6 versus Lodash, especially since the new integrations would be faster (being native). Babel is a life saver!!
Psst. The third example, the
.some
example, is likely to confuse a few folks due to the<= 18
that should read>= 18
(like the.every
example).That one typo aside, this is a great list and if I did such an article, my list would probably match this.
Thanks. Just noticed and made the change.
This is about Object.assign Example 2 -
const source1 = { "propA": 1 };
const source2 = { "propB": 2 };
const source3 = { "propC": 3 };
const target = Object.assign(source1, source2, source);
After execution of the above lines,
// target = { "propA": 1, "propB": 2, "propC": 3 };
also, it will update source1.
// source1 = { "propA": 1, "propB": 2, "propC": 3 };
if we don't want to update any of our existing sources, the correct way to write is
const target = Object.assign({}, source1, source2, source);
Great Article! I m a beginner and though it's necessary to know many things in JavaScript, very nice to know what you should get use to using right away. thanks for the article.
Thanks!!
that's awesome, as JS developer, what you mentioned is relative for me as well. I am also using the same methods as every day. great sharing. thanks, Martin.