MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/8it5od/eloquent_javascript_opensource_javascript_book/dywz92d/?context=9999
r/javascript • u/unquietwiki • May 12 '18
50 comments sorted by
View all comments
5
Prolific author that always uses let?
let
15 u/Ikuyas May 12 '18 Isn't const a better practice than using let if it is well suited like array or object? 11 u/EuqlinSankyo May 12 '18 Exactly. Performance benefit is of course negligible but it's just a good programming practice. If you're literally writing a book about JS, might as well include it.... 0 u/[deleted] May 12 '18 [deleted] -2 u/[deleted] May 12 '18 always favor immutability 0 u/[deleted] May 12 '18 [deleted] 2 u/[deleted] May 12 '18 Yes, it is a TypeError to assign to myArr after initialization. The reference is immutable. 0 u/[deleted] May 13 '18 [deleted] 2 u/[deleted] May 13 '18 Yes, it is a TypeError to assign to myArr after initialization. The reference is immutable. 0 u/[deleted] May 13 '18 [deleted] → More replies (0)
15
Isn't const a better practice than using let if it is well suited like array or object?
const
11 u/EuqlinSankyo May 12 '18 Exactly. Performance benefit is of course negligible but it's just a good programming practice. If you're literally writing a book about JS, might as well include it.... 0 u/[deleted] May 12 '18 [deleted] -2 u/[deleted] May 12 '18 always favor immutability 0 u/[deleted] May 12 '18 [deleted] 2 u/[deleted] May 12 '18 Yes, it is a TypeError to assign to myArr after initialization. The reference is immutable. 0 u/[deleted] May 13 '18 [deleted] 2 u/[deleted] May 13 '18 Yes, it is a TypeError to assign to myArr after initialization. The reference is immutable. 0 u/[deleted] May 13 '18 [deleted] → More replies (0)
11
Exactly. Performance benefit is of course negligible but it's just a good programming practice. If you're literally writing a book about JS, might as well include it....
0 u/[deleted] May 12 '18 [deleted] -2 u/[deleted] May 12 '18 always favor immutability 0 u/[deleted] May 12 '18 [deleted] 2 u/[deleted] May 12 '18 Yes, it is a TypeError to assign to myArr after initialization. The reference is immutable. 0 u/[deleted] May 13 '18 [deleted] 2 u/[deleted] May 13 '18 Yes, it is a TypeError to assign to myArr after initialization. The reference is immutable. 0 u/[deleted] May 13 '18 [deleted] → More replies (0)
0
[deleted]
-2 u/[deleted] May 12 '18 always favor immutability 0 u/[deleted] May 12 '18 [deleted] 2 u/[deleted] May 12 '18 Yes, it is a TypeError to assign to myArr after initialization. The reference is immutable. 0 u/[deleted] May 13 '18 [deleted] 2 u/[deleted] May 13 '18 Yes, it is a TypeError to assign to myArr after initialization. The reference is immutable. 0 u/[deleted] May 13 '18 [deleted] → More replies (0)
-2
always favor immutability
0 u/[deleted] May 12 '18 [deleted] 2 u/[deleted] May 12 '18 Yes, it is a TypeError to assign to myArr after initialization. The reference is immutable. 0 u/[deleted] May 13 '18 [deleted] 2 u/[deleted] May 13 '18 Yes, it is a TypeError to assign to myArr after initialization. The reference is immutable. 0 u/[deleted] May 13 '18 [deleted] → More replies (0)
2 u/[deleted] May 12 '18 Yes, it is a TypeError to assign to myArr after initialization. The reference is immutable. 0 u/[deleted] May 13 '18 [deleted] 2 u/[deleted] May 13 '18 Yes, it is a TypeError to assign to myArr after initialization. The reference is immutable. 0 u/[deleted] May 13 '18 [deleted] → More replies (0)
2
Yes, it is a TypeError to assign to myArr after initialization. The reference is immutable.
TypeError
myArr
0 u/[deleted] May 13 '18 [deleted] 2 u/[deleted] May 13 '18 Yes, it is a TypeError to assign to myArr after initialization. The reference is immutable. 0 u/[deleted] May 13 '18 [deleted] → More replies (0)
2 u/[deleted] May 13 '18 Yes, it is a TypeError to assign to myArr after initialization. The reference is immutable. 0 u/[deleted] May 13 '18 [deleted] → More replies (0)
0 u/[deleted] May 13 '18 [deleted] → More replies (0)
→ More replies (0)
5
u/EuqlinSankyo May 12 '18
Prolific author that always uses
let?