extract vars in javascript