Why does {. . . .0} evaluate to {}?
I just found {....0}
in friend's code. Evaluating it in console returns {}
(empty object).
Why is that? What is the meaning of 4 dots in JavaScript?
javascript spread-syntax number-literal
New contributor
add a comment |
I just found {....0}
in friend's code. Evaluating it in console returns {}
(empty object).
Why is that? What is the meaning of 4 dots in JavaScript?
javascript spread-syntax number-literal
New contributor
9
Viewed almost 2500 times in 6 hours? It appears your friend is using the spread operator in a different context.
– Jeremy Harris
2 days ago
This is more of a "how this expression is parsed" question. Type this in JS console and you'll notice that the 4th dot is colored differently... same color as zero.
– Salman A
yesterday
1
Always relevant
– MikeTheLiar
yesterday
@JeremyHarris the magic of HNQ
– Pac0
yesterday
add a comment |
I just found {....0}
in friend's code. Evaluating it in console returns {}
(empty object).
Why is that? What is the meaning of 4 dots in JavaScript?
javascript spread-syntax number-literal
New contributor
I just found {....0}
in friend's code. Evaluating it in console returns {}
(empty object).
Why is that? What is the meaning of 4 dots in JavaScript?
javascript spread-syntax number-literal
javascript spread-syntax number-literal
New contributor
New contributor
edited 2 days ago
New contributor
asked 2 days ago
Mist
35937
35937
New contributor
New contributor
9
Viewed almost 2500 times in 6 hours? It appears your friend is using the spread operator in a different context.
– Jeremy Harris
2 days ago
This is more of a "how this expression is parsed" question. Type this in JS console and you'll notice that the 4th dot is colored differently... same color as zero.
– Salman A
yesterday
1
Always relevant
– MikeTheLiar
yesterday
@JeremyHarris the magic of HNQ
– Pac0
yesterday
add a comment |
9
Viewed almost 2500 times in 6 hours? It appears your friend is using the spread operator in a different context.
– Jeremy Harris
2 days ago
This is more of a "how this expression is parsed" question. Type this in JS console and you'll notice that the 4th dot is colored differently... same color as zero.
– Salman A
yesterday
1
Always relevant
– MikeTheLiar
yesterday
@JeremyHarris the magic of HNQ
– Pac0
yesterday
9
9
Viewed almost 2500 times in 6 hours? It appears your friend is using the spread operator in a different context.
– Jeremy Harris
2 days ago
Viewed almost 2500 times in 6 hours? It appears your friend is using the spread operator in a different context.
– Jeremy Harris
2 days ago
This is more of a "how this expression is parsed" question. Type this in JS console and you'll notice that the 4th dot is colored differently... same color as zero.
– Salman A
yesterday
This is more of a "how this expression is parsed" question. Type this in JS console and you'll notice that the 4th dot is colored differently... same color as zero.
– Salman A
yesterday
1
1
Always relevant
– MikeTheLiar
yesterday
Always relevant
– MikeTheLiar
yesterday
@JeremyHarris the magic of HNQ
– Pac0
yesterday
@JeremyHarris the magic of HNQ
– Pac0
yesterday
add a comment |
3 Answers
3
active
oldest
votes
Four dots actually have no meaning. ...
is the spread operator, and .0
is short for 0.0
.
Spreading 0 (or any number) into an object yields an empty object, therefore {}
.
9
Spreading any number yields an empty object.
– Kresimir
2 days ago
8
Spreading 0 (or any number) yields an empty object
not necessarily if you spread a number at any other places apart from an object, it will throw an error eg [...0] throws an error.
– Hitesh Kumar
2 days ago
2
@HiteshKumar Spreading non-iterable objects inside an array will indeed throw an error, but that has nothing to do with this question. I am referring to the object-spread mentioned. :)
– NikxDa
2 days ago
2
NikxDa I think that @HiteshKumar made an important point. It's better to be more explicit about cases where your statements holds true.Spreading 0 (or any number) in object literal yields an empty object
Contains more useful information..
– Mist
2 days ago
1
@Mist I've updated the answer. I don't think it's needed, but it might be good for clarification. Thanks for the update!
– NikxDa
2 days ago
|
show 2 more comments
Three dots in an object literal are a spread property, e.g.:
const a = { b: 1, c: 1 };
const d = { ...a, e: 1 }; // { b: 1, c: 1, e: 1 }
The last dot with a 0 is a number literal .0
is the same as 0.0
. Therefore this:
{ ...(0.0) }
spreads all properties of the number object into the object, however as numbers don't have any (own) properties you get back an empty object.
You lead me to thinking - I can spread any variable, and own keys will be spread into the new object? It works forFunction
(function x() {}), (x.k = 'v'), ({...x})// {k: 'v'}
but doesn't work forNumber
(x = 10), (x.k = 'v'), ({...x}) // {}
– Mist
2 days ago
3
@mist because numbers (and other primitives) get "boxed" into objects when you work with them as objects, and "unboxed" directly afterwards. Thereforex.k
will get lost.
– Jonas Wilms
2 days ago
What does 'boxed' means exactly? E.g. when I used the dot operator (property) I worked with the number as object. If I am correct, that's just one case. Are there other cases when 'boxing' is happening? Does it apply only to numbers? Is there a perf reason or something? I guess this is for other question, and I should study it further. Could you point me to some book or something?
– Mist
2 days ago
1
Thanks! I see why my key on number couldn't work. Yayy boxing!
– Mist
2 days ago
3
Numbers don't have any own enumerable properties. But they do have properties.
– Patrick Roberts
2 days ago
|
show 4 more comments
In a simple terms {...}
spread operator in javascript extends one object/array with another.
So, when babelifier tries extending one with another, it has to identify whether it is trying to extend an array or an object.
In the case of array
, it iterates over elements.
In the case of object
, it iterates over keys.
In this scenario, the babelyfier is trying to extract keys for number
by checking the Object's own property call
which is missing for number
so it returns empty Object.
7
new word! i.stack.imgur.com/VyYqA.png
– uhoh
yesterday
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Mist is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53922010%2fwhy-does-0-evaluate-to%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Four dots actually have no meaning. ...
is the spread operator, and .0
is short for 0.0
.
Spreading 0 (or any number) into an object yields an empty object, therefore {}
.
9
Spreading any number yields an empty object.
– Kresimir
2 days ago
8
Spreading 0 (or any number) yields an empty object
not necessarily if you spread a number at any other places apart from an object, it will throw an error eg [...0] throws an error.
– Hitesh Kumar
2 days ago
2
@HiteshKumar Spreading non-iterable objects inside an array will indeed throw an error, but that has nothing to do with this question. I am referring to the object-spread mentioned. :)
– NikxDa
2 days ago
2
NikxDa I think that @HiteshKumar made an important point. It's better to be more explicit about cases where your statements holds true.Spreading 0 (or any number) in object literal yields an empty object
Contains more useful information..
– Mist
2 days ago
1
@Mist I've updated the answer. I don't think it's needed, but it might be good for clarification. Thanks for the update!
– NikxDa
2 days ago
|
show 2 more comments
Four dots actually have no meaning. ...
is the spread operator, and .0
is short for 0.0
.
Spreading 0 (or any number) into an object yields an empty object, therefore {}
.
9
Spreading any number yields an empty object.
– Kresimir
2 days ago
8
Spreading 0 (or any number) yields an empty object
not necessarily if you spread a number at any other places apart from an object, it will throw an error eg [...0] throws an error.
– Hitesh Kumar
2 days ago
2
@HiteshKumar Spreading non-iterable objects inside an array will indeed throw an error, but that has nothing to do with this question. I am referring to the object-spread mentioned. :)
– NikxDa
2 days ago
2
NikxDa I think that @HiteshKumar made an important point. It's better to be more explicit about cases where your statements holds true.Spreading 0 (or any number) in object literal yields an empty object
Contains more useful information..
– Mist
2 days ago
1
@Mist I've updated the answer. I don't think it's needed, but it might be good for clarification. Thanks for the update!
– NikxDa
2 days ago
|
show 2 more comments
Four dots actually have no meaning. ...
is the spread operator, and .0
is short for 0.0
.
Spreading 0 (or any number) into an object yields an empty object, therefore {}
.
Four dots actually have no meaning. ...
is the spread operator, and .0
is short for 0.0
.
Spreading 0 (or any number) into an object yields an empty object, therefore {}
.
edited 2 days ago
answered 2 days ago
NikxDa
2,78311531
2,78311531
9
Spreading any number yields an empty object.
– Kresimir
2 days ago
8
Spreading 0 (or any number) yields an empty object
not necessarily if you spread a number at any other places apart from an object, it will throw an error eg [...0] throws an error.
– Hitesh Kumar
2 days ago
2
@HiteshKumar Spreading non-iterable objects inside an array will indeed throw an error, but that has nothing to do with this question. I am referring to the object-spread mentioned. :)
– NikxDa
2 days ago
2
NikxDa I think that @HiteshKumar made an important point. It's better to be more explicit about cases where your statements holds true.Spreading 0 (or any number) in object literal yields an empty object
Contains more useful information..
– Mist
2 days ago
1
@Mist I've updated the answer. I don't think it's needed, but it might be good for clarification. Thanks for the update!
– NikxDa
2 days ago
|
show 2 more comments
9
Spreading any number yields an empty object.
– Kresimir
2 days ago
8
Spreading 0 (or any number) yields an empty object
not necessarily if you spread a number at any other places apart from an object, it will throw an error eg [...0] throws an error.
– Hitesh Kumar
2 days ago
2
@HiteshKumar Spreading non-iterable objects inside an array will indeed throw an error, but that has nothing to do with this question. I am referring to the object-spread mentioned. :)
– NikxDa
2 days ago
2
NikxDa I think that @HiteshKumar made an important point. It's better to be more explicit about cases where your statements holds true.Spreading 0 (or any number) in object literal yields an empty object
Contains more useful information..
– Mist
2 days ago
1
@Mist I've updated the answer. I don't think it's needed, but it might be good for clarification. Thanks for the update!
– NikxDa
2 days ago
9
9
Spreading any number yields an empty object.
– Kresimir
2 days ago
Spreading any number yields an empty object.
– Kresimir
2 days ago
8
8
Spreading 0 (or any number) yields an empty object
not necessarily if you spread a number at any other places apart from an object, it will throw an error eg [...0] throws an error.– Hitesh Kumar
2 days ago
Spreading 0 (or any number) yields an empty object
not necessarily if you spread a number at any other places apart from an object, it will throw an error eg [...0] throws an error.– Hitesh Kumar
2 days ago
2
2
@HiteshKumar Spreading non-iterable objects inside an array will indeed throw an error, but that has nothing to do with this question. I am referring to the object-spread mentioned. :)
– NikxDa
2 days ago
@HiteshKumar Spreading non-iterable objects inside an array will indeed throw an error, but that has nothing to do with this question. I am referring to the object-spread mentioned. :)
– NikxDa
2 days ago
2
2
NikxDa I think that @HiteshKumar made an important point. It's better to be more explicit about cases where your statements holds true.
Spreading 0 (or any number) in object literal yields an empty object
Contains more useful information..– Mist
2 days ago
NikxDa I think that @HiteshKumar made an important point. It's better to be more explicit about cases where your statements holds true.
Spreading 0 (or any number) in object literal yields an empty object
Contains more useful information..– Mist
2 days ago
1
1
@Mist I've updated the answer. I don't think it's needed, but it might be good for clarification. Thanks for the update!
– NikxDa
2 days ago
@Mist I've updated the answer. I don't think it's needed, but it might be good for clarification. Thanks for the update!
– NikxDa
2 days ago
|
show 2 more comments
Three dots in an object literal are a spread property, e.g.:
const a = { b: 1, c: 1 };
const d = { ...a, e: 1 }; // { b: 1, c: 1, e: 1 }
The last dot with a 0 is a number literal .0
is the same as 0.0
. Therefore this:
{ ...(0.0) }
spreads all properties of the number object into the object, however as numbers don't have any (own) properties you get back an empty object.
You lead me to thinking - I can spread any variable, and own keys will be spread into the new object? It works forFunction
(function x() {}), (x.k = 'v'), ({...x})// {k: 'v'}
but doesn't work forNumber
(x = 10), (x.k = 'v'), ({...x}) // {}
– Mist
2 days ago
3
@mist because numbers (and other primitives) get "boxed" into objects when you work with them as objects, and "unboxed" directly afterwards. Thereforex.k
will get lost.
– Jonas Wilms
2 days ago
What does 'boxed' means exactly? E.g. when I used the dot operator (property) I worked with the number as object. If I am correct, that's just one case. Are there other cases when 'boxing' is happening? Does it apply only to numbers? Is there a perf reason or something? I guess this is for other question, and I should study it further. Could you point me to some book or something?
– Mist
2 days ago
1
Thanks! I see why my key on number couldn't work. Yayy boxing!
– Mist
2 days ago
3
Numbers don't have any own enumerable properties. But they do have properties.
– Patrick Roberts
2 days ago
|
show 4 more comments
Three dots in an object literal are a spread property, e.g.:
const a = { b: 1, c: 1 };
const d = { ...a, e: 1 }; // { b: 1, c: 1, e: 1 }
The last dot with a 0 is a number literal .0
is the same as 0.0
. Therefore this:
{ ...(0.0) }
spreads all properties of the number object into the object, however as numbers don't have any (own) properties you get back an empty object.
You lead me to thinking - I can spread any variable, and own keys will be spread into the new object? It works forFunction
(function x() {}), (x.k = 'v'), ({...x})// {k: 'v'}
but doesn't work forNumber
(x = 10), (x.k = 'v'), ({...x}) // {}
– Mist
2 days ago
3
@mist because numbers (and other primitives) get "boxed" into objects when you work with them as objects, and "unboxed" directly afterwards. Thereforex.k
will get lost.
– Jonas Wilms
2 days ago
What does 'boxed' means exactly? E.g. when I used the dot operator (property) I worked with the number as object. If I am correct, that's just one case. Are there other cases when 'boxing' is happening? Does it apply only to numbers? Is there a perf reason or something? I guess this is for other question, and I should study it further. Could you point me to some book or something?
– Mist
2 days ago
1
Thanks! I see why my key on number couldn't work. Yayy boxing!
– Mist
2 days ago
3
Numbers don't have any own enumerable properties. But they do have properties.
– Patrick Roberts
2 days ago
|
show 4 more comments
Three dots in an object literal are a spread property, e.g.:
const a = { b: 1, c: 1 };
const d = { ...a, e: 1 }; // { b: 1, c: 1, e: 1 }
The last dot with a 0 is a number literal .0
is the same as 0.0
. Therefore this:
{ ...(0.0) }
spreads all properties of the number object into the object, however as numbers don't have any (own) properties you get back an empty object.
Three dots in an object literal are a spread property, e.g.:
const a = { b: 1, c: 1 };
const d = { ...a, e: 1 }; // { b: 1, c: 1, e: 1 }
The last dot with a 0 is a number literal .0
is the same as 0.0
. Therefore this:
{ ...(0.0) }
spreads all properties of the number object into the object, however as numbers don't have any (own) properties you get back an empty object.
edited yesterday
answered 2 days ago
Jonas Wilms
54.8k42749
54.8k42749
You lead me to thinking - I can spread any variable, and own keys will be spread into the new object? It works forFunction
(function x() {}), (x.k = 'v'), ({...x})// {k: 'v'}
but doesn't work forNumber
(x = 10), (x.k = 'v'), ({...x}) // {}
– Mist
2 days ago
3
@mist because numbers (and other primitives) get "boxed" into objects when you work with them as objects, and "unboxed" directly afterwards. Thereforex.k
will get lost.
– Jonas Wilms
2 days ago
What does 'boxed' means exactly? E.g. when I used the dot operator (property) I worked with the number as object. If I am correct, that's just one case. Are there other cases when 'boxing' is happening? Does it apply only to numbers? Is there a perf reason or something? I guess this is for other question, and I should study it further. Could you point me to some book or something?
– Mist
2 days ago
1
Thanks! I see why my key on number couldn't work. Yayy boxing!
– Mist
2 days ago
3
Numbers don't have any own enumerable properties. But they do have properties.
– Patrick Roberts
2 days ago
|
show 4 more comments
You lead me to thinking - I can spread any variable, and own keys will be spread into the new object? It works forFunction
(function x() {}), (x.k = 'v'), ({...x})// {k: 'v'}
but doesn't work forNumber
(x = 10), (x.k = 'v'), ({...x}) // {}
– Mist
2 days ago
3
@mist because numbers (and other primitives) get "boxed" into objects when you work with them as objects, and "unboxed" directly afterwards. Thereforex.k
will get lost.
– Jonas Wilms
2 days ago
What does 'boxed' means exactly? E.g. when I used the dot operator (property) I worked with the number as object. If I am correct, that's just one case. Are there other cases when 'boxing' is happening? Does it apply only to numbers? Is there a perf reason or something? I guess this is for other question, and I should study it further. Could you point me to some book or something?
– Mist
2 days ago
1
Thanks! I see why my key on number couldn't work. Yayy boxing!
– Mist
2 days ago
3
Numbers don't have any own enumerable properties. But they do have properties.
– Patrick Roberts
2 days ago
You lead me to thinking - I can spread any variable, and own keys will be spread into the new object? It works for
Function
(function x() {}), (x.k = 'v'), ({...x})// {k: 'v'}
but doesn't work for Number
(x = 10), (x.k = 'v'), ({...x}) // {}
– Mist
2 days ago
You lead me to thinking - I can spread any variable, and own keys will be spread into the new object? It works for
Function
(function x() {}), (x.k = 'v'), ({...x})// {k: 'v'}
but doesn't work for Number
(x = 10), (x.k = 'v'), ({...x}) // {}
– Mist
2 days ago
3
3
@mist because numbers (and other primitives) get "boxed" into objects when you work with them as objects, and "unboxed" directly afterwards. Therefore
x.k
will get lost.– Jonas Wilms
2 days ago
@mist because numbers (and other primitives) get "boxed" into objects when you work with them as objects, and "unboxed" directly afterwards. Therefore
x.k
will get lost.– Jonas Wilms
2 days ago
What does 'boxed' means exactly? E.g. when I used the dot operator (property) I worked with the number as object. If I am correct, that's just one case. Are there other cases when 'boxing' is happening? Does it apply only to numbers? Is there a perf reason or something? I guess this is for other question, and I should study it further. Could you point me to some book or something?
– Mist
2 days ago
What does 'boxed' means exactly? E.g. when I used the dot operator (property) I worked with the number as object. If I am correct, that's just one case. Are there other cases when 'boxing' is happening? Does it apply only to numbers? Is there a perf reason or something? I guess this is for other question, and I should study it further. Could you point me to some book or something?
– Mist
2 days ago
1
1
Thanks! I see why my key on number couldn't work. Yayy boxing!
– Mist
2 days ago
Thanks! I see why my key on number couldn't work. Yayy boxing!
– Mist
2 days ago
3
3
Numbers don't have any own enumerable properties. But they do have properties.
– Patrick Roberts
2 days ago
Numbers don't have any own enumerable properties. But they do have properties.
– Patrick Roberts
2 days ago
|
show 4 more comments
In a simple terms {...}
spread operator in javascript extends one object/array with another.
So, when babelifier tries extending one with another, it has to identify whether it is trying to extend an array or an object.
In the case of array
, it iterates over elements.
In the case of object
, it iterates over keys.
In this scenario, the babelyfier is trying to extract keys for number
by checking the Object's own property call
which is missing for number
so it returns empty Object.
7
new word! i.stack.imgur.com/VyYqA.png
– uhoh
yesterday
add a comment |
In a simple terms {...}
spread operator in javascript extends one object/array with another.
So, when babelifier tries extending one with another, it has to identify whether it is trying to extend an array or an object.
In the case of array
, it iterates over elements.
In the case of object
, it iterates over keys.
In this scenario, the babelyfier is trying to extract keys for number
by checking the Object's own property call
which is missing for number
so it returns empty Object.
7
new word! i.stack.imgur.com/VyYqA.png
– uhoh
yesterday
add a comment |
In a simple terms {...}
spread operator in javascript extends one object/array with another.
So, when babelifier tries extending one with another, it has to identify whether it is trying to extend an array or an object.
In the case of array
, it iterates over elements.
In the case of object
, it iterates over keys.
In this scenario, the babelyfier is trying to extract keys for number
by checking the Object's own property call
which is missing for number
so it returns empty Object.
In a simple terms {...}
spread operator in javascript extends one object/array with another.
So, when babelifier tries extending one with another, it has to identify whether it is trying to extend an array or an object.
In the case of array
, it iterates over elements.
In the case of object
, it iterates over keys.
In this scenario, the babelyfier is trying to extract keys for number
by checking the Object's own property call
which is missing for number
so it returns empty Object.
edited yesterday
answered yesterday
Rajendra kumar Vankadari
1,087911
1,087911
7
new word! i.stack.imgur.com/VyYqA.png
– uhoh
yesterday
add a comment |
7
new word! i.stack.imgur.com/VyYqA.png
– uhoh
yesterday
7
7
new word! i.stack.imgur.com/VyYqA.png
– uhoh
yesterday
new word! i.stack.imgur.com/VyYqA.png
– uhoh
yesterday
add a comment |
Mist is a new contributor. Be nice, and check out our Code of Conduct.
Mist is a new contributor. Be nice, and check out our Code of Conduct.
Mist is a new contributor. Be nice, and check out our Code of Conduct.
Mist is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53922010%2fwhy-does-0-evaluate-to%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
9
Viewed almost 2500 times in 6 hours? It appears your friend is using the spread operator in a different context.
– Jeremy Harris
2 days ago
This is more of a "how this expression is parsed" question. Type this in JS console and you'll notice that the 4th dot is colored differently... same color as zero.
– Salman A
yesterday
1
Always relevant
– MikeTheLiar
yesterday
@JeremyHarris the magic of HNQ
– Pac0
yesterday