|
|
|
|
|
by lucideer
1994 days ago
|
|
I don't know why that space is there, it could be accidental or a deliberate stylistic quirk of the author, but it seems harmless (if not idiomatic). > How is this valid JS? What does it do? I'm curious if Python (or a similar whitespace-sensitive syntax) is your first/familiar programming language. The extra whitespace here does nothing. The semicolon in JS is an (optional) expression separator, similar to in Bash/Shell. It can occur at the end of a line or at the beginning of a line, or in between lines. Or in between two expressions on a single line. Any whitespace chars before or after it are irrelevant/ignored. |
|
Their question was:
>Why is there a string right after the field "button" of the object "styled"?
which unambiguously refers to the double backtick characters between "styled.button" and the semicolon in this expression:
> export const Button = styled.button``;
That is, in JavaScript, an empty string. There is not whitespace and Python has nothing at all to do with the question. Similarly, an explanation of what a semicolon does in JavaScript does not answer the question.
I also can't answer the question for them as I haven't kept up with newer JavaScript standards, but I thought it important that you realise you misunderstood something here.