MJ
asked on
Any issues with combining logic?
I'm streamlining my code and I did the following;
and combined to:
Any issues doing this? It works but I haven't checked on anything other than FF.
var currVarNm = aa.varMapping('deviceType','props');
window[aa.prefix][currVarNm] = deviceType.toLowerCase();
and combined to:
window[aa.prefix][aa.varMapping('deviceType','props')] = deviceType.toLowerCase();
Any issues doing this? It works but I haven't checked on anything other than FF.
I'm not sure what the point is since it doesn't speed it up any and makes it harder to read and maintain. Almost all interpreters these days precompile the code, they don't run it exactly as you type it. So any attempts at shortcuts are usually meaningless and just make it more difficult to maintain.
ASKER
I just wanted to minimize the # of lines for some code. So you think it is a bad idea then?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
You're welcome, glad to help.