I deleted my old post as it contained a lot of spam. And I created a jsfiddle to reproduce the issue I am having.
console.clear();
var args = '{ action: downline }';
showObject(args);
showObject({ action: 'downline' });
function showObject(args) {
console.log(args);
}
How do I pass args as an object? I'm currently building args into a string dynamically and need to pass it as an object for the function to work correctly.
showObject(JSON.parse(args)).