Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. function magic(source, keys) {
  2. var result = {};
  3. var tmp = source.toString().substring(1, source.length-1);
  4. Logger.log(tmp);
  5. var arr = tmp.split(',');
  6. Logger.log(arr);
  7. if(arr && arr.length > 0) {
  8. arr.forEach(function(arg) {
  9. var param = arg.split(' ').join('').split('=');
  10. if(keys.indexOf(param[0]) > -1) {
  11. result[param[0]] = param[1];
  12. }
  13. });
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement