DEV Community

Discussion on: Are the codes written/read left to right ?! (a misconception among beginners)

Collapse
 
colocodes profile image
Damian Demasi • Edited

const result = await name.save()

I would read this code as follows: “create a constant variable named result and store in it the result/response of awaiting for the name to be saved”.

But even better, I think is best to read it as we read mathematical equations: from outside to inside.

Collapse
 
hoomantalakian profile image
Hooman Talakian

Of course, this code can be read, just as you said. This is exactly what "different thinking" is all about. We have just mentioned "one" way of thinking.
By the way, I appreciate your point of view about the mathematical approach.