@@ -2007,10 +2007,10 @@ Let's try to coerce a number to a string:
2007
2007
27 .toString () // > Uncaught SyntaxError: Invalid or unexpected token
2008
2008
```
2009
2009
2010
- Maybe we should try with a two dots?
2010
+ Maybe we should try with two dots?
2011
2011
2012
2012
``` js
2013
- ( 27 ) .toString (); // -> '27'
2013
+ 27. .toString (); // -> '27'
2014
2014
```
2015
2015
2016
2016
But why doesn't first example work?
@@ -2028,7 +2028,7 @@ You must always use parenthesis or an addition dot to make such expression valid
2028
2028
``` js
2029
2029
(27 ).toString (); // -> '27'
2030
2030
// or
2031
- ( 27 ) .toString (); // -> '27'
2031
+ 27. .toString (); // -> '27'
2032
2032
```
2033
2033
2034
2034
- [ Usage of toString in JavaScript] ( https://stackoverflow.com/questions/6853865/usage-of-tostring-in-javascript/6853910#6853910 ) on StackOverflow
@@ -2087,7 +2087,8 @@ Writing some standard JavaScript… and then BOOM!
2087
2087
2088
2088
``` js
2089
2089
class SomeClass {
2090
- [" array" ] = ([][" string" ] = " str" );
2090
+ [" array" ] = []
2091
+ [" string" ] = " str"
2091
2092
}
2092
2093
2093
2094
new SomeClass ().array ; // -> 'str'
@@ -2109,7 +2110,7 @@ class SomeClass {
2109
2110
2110
2111
You basically assign a string ` str ` into an ` array ` property.
2111
2112
2112
- - [ An original tween with an example] ( https://twitter.com/SeaRyanC/status/1148726605222535168 ) by Ryan Cavanaugh
2113
+ - [ An original tweet with an example] ( https://twitter.com/SeaRyanC/status/1148726605222535168 ) by Ryan Cavanaugh
2113
2114
- [ TC39 meeting when they debated about it] ( https://github.com/tc39/notes/blob/master/meetings/2017-09/sept-26.md )
2114
2115
2115
2116
## Split a string by a space
0 commit comments