Link to home
Start Free TrialLog in
Avatar of MJ
MJFlag for United States of America

asked on

Any issues with combining logic?

I'm streamlining my code and I did the following;
    var currVarNm = aa.varMapping('deviceType','props');
    window[aa.prefix][currVarNm] = deviceType.toLowerCase();

Open in new window


and combined to:
window[aa.prefix][aa.varMapping('deviceType','props')] = deviceType.toLowerCase();

Open in new window


Any issues doing this? It works but I haven't checked on anything other than FF.
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

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.
Avatar of MJ

ASKER

I just wanted to minimize the # of lines for some code. So you think it is a bad idea then?
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MJ

ASKER

Thanks!
You're welcome, glad to help.