I am wondering whether I can use variables that I pass to a function as arguments as "literals" (I don't know a better way to describe the problem, perhaps the example will clear things up):
banana = yellow;
minion = cute;
function ex(banana, minion) {
banana.minion;
}
// What I want is: yellow.cute
Edit I think I might not have been asking exactly what I meant. I'm sorry for that. Here's the actual code that might clarify things.
function ex(banana, minion){
createjs.Tween.get(banana, {override: true}).to({banana: minion}, -(value + -banana.minion) * speed, createjs.Ease.ease);
console.log(banana); // returns 'yellow'
console.log(minion); // returns 'cute'
console.log(banana.minion); // returns 'undefined'
console.log(banana[minion]); // returns 'undefined' too
}
So I want to pass whatever I define as banana
or minion
to be 'literal', so that it will read createjs.Tween.get(yellow, {override: true}).to({yellow: cute}, -(value + -yellow.cute) * speed, createjs.Ease.ease);