Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript LHS and RHS Lookup

Tags:

I was reading the Scopes and Closure of You don't know JS book by Kyle Simpson, specifically this topic Compiler Speak.

There they mention the LHS and RHS lookup. I am failed to understand these two terms, can anyone help me to realize them?

like image 945
ZIS Avatar asked Apr 03 '16 09:04

ZIS


1 Answers

LHS look-up is done when a variable appears on the left-hand side of an assignment operation, and an RHS look-up is done when a variable appears on the right-hand side of an assignment operation.

I think of it as follows :
lhs lookup is a container lookup
rhs lookup is a value lookup

like image 180
Ahmed Eid Avatar answered Sep 22 '22 17:09

Ahmed Eid