Skip to content

Instantly share code, notes, and snippets.

@shahab1363
Created June 9, 2014 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shahab1363/01afbb0b34a630c95886 to your computer and use it in GitHub Desktop.
Save shahab1363/01afbb0b34a630c95886 to your computer and use it in GitHub Desktop.
// working version: http://jsfiddle.net/gbsandeep/2TmaG/
var jsonData = [
{
"enable-read-parnian":true,
"enable-radio":true,
"enable-business-directory":true,
"enable-contact-us":true,
"enable-settings":true,
"enable-subscription":true
}
];
for(var obj in jsonData){
if(jsonData.hasOwnProperty(obj)){
for(var prop in jsonData[obj]){
var newProp = prop.toUpperCase().replace(/-/g, '_');
document.write('#define GTM_KEY_' + newProp + ' @"' + prop + '"');
document.write('<br/>');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment