How do I make nav_items work in the following context?
params = {
nav: $('.nav'),
nav_items: params.nav.find('li')
}
ReferenceError: params is not defined (logically true)
Also tried this:
params = {
nav: $('.nav'),
nav_items: nav.find('li')
}
ReferenceError: nav is not defined (what is the right way?)
I know, it can be done using this code:
params = {
nav: $('.nav'),
nav_items: null
}
params.nav_items = nav.find('li');
But its interesting, can it be done without an extra code?