Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function magic(source, keys) {
- var result = {};
- source.slice(1, -1).split(',').map(arg => {
- var param = arg.split(' ').join('').split('=');
- if(keys.indexOf(param[0]) > -1) {
- result[param[0]] = param[1];
- }
- });
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement