Making an argument object become private varaibles js

0 votes
55 views
asked Jan 18, 2013 in java script by BasicQuestion (1,355 points)

I have a function which you can pass an object to. I then need all the vars within this object to become local variables. For instance

1 Answer

0 votes
answered Jan 18, 2013 by anonymous

Simply do

function ping(obj){
    return obj.riff;
}

or

function ping(obj){
    var riff = obj.riff;

    return riff;
}
...