3 ms·
> Named cells look like, and function almost like, assignment expressions in vanilla JavaScript > But sometimes you want statements, such as for loops. For tha
by zokier 3y ago
> Named cells look like, and function almost like, assignment expressions in vanilla JavaScript
> But sometimes you want statements, such as for loops. For that you'll need curly braces, and a return statement to give the cell a value. Think of a cell as a function, except the function has no arguments
So `x = { let y = 5; return y }` declares named cell x with value from the return value of that function-like code block. So basically that should be same as `x = 5`, which also is named cell declaration and not JS variable assignment.