Why getColorOptionSelect() return undefined value (I\'m sure it has a value by debugger ).
It is for sure an issue related to the scope, sorry for my js ignorance >
getColorOptionSelect doesn't have an (uncommented) return statement.
The only return statement you have is inside the anonymous function you pass to each(). It will be consumed by the code underlying each() (which will stop looping if it is false).
This isn't a problem of scope, just of there being multiple functions.
You probably want to:
each()getColorOptionSelect