MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/bidtu1/7_useful_javascript_tricks/em4exr2/?context=3
r/javascript • u/xxammuxx • Apr 28 '19
36 comments sorted by
View all comments
-5
great article, tricks with spreading set and creating "pure" objects show 2 sides of JS:
1 - expressing things with short, elegant expressions, but not very good about performance
2 - if you want, you CAN care about performance and memory usage of your JS apps
5 u/__ibowankenobi__ Apr 28 '19 FYI, when you create a pure object, it has no impact on memory whatsoever, because those function's from Object.prototype are never copied. And I really really doubt they have performance benefits. 0 u/[deleted] Apr 29 '19 [deleted] 1 u/__ibowankenobi__ Apr 30 '19 Yes, technically that would save you 8 bytes.
5
FYI, when you create a pure object, it has no impact on memory whatsoever, because those function's from Object.prototype are never copied. And I really really doubt they have performance benefits.
0 u/[deleted] Apr 29 '19 [deleted] 1 u/__ibowankenobi__ Apr 30 '19 Yes, technically that would save you 8 bytes.
0
[deleted]
1 u/__ibowankenobi__ Apr 30 '19 Yes, technically that would save you 8 bytes.
1
Yes, technically that would save you 8 bytes.
-5
u/timarama Apr 28 '19
great article, tricks with spreading set and creating "pure" objects show 2 sides of JS:
1 - expressing things with short, elegant expressions, but not very good about performance
2 - if you want, you CAN care about performance and memory usage of your JS apps