Skip to content

Instantly share code, notes, and snippets.

@hassanuos
Created March 24, 2024 05:41
Show Gist options
  • Save hassanuos/847b89401b8fab97cfe3db3fb58d3653 to your computer and use it in GitHub Desktop.
Save hassanuos/847b89401b8fab97cfe3db3fb58d3653 to your computer and use it in GitHub Desktop.
let vals = [];
'["small","medium","large","extra-large"]'.split('"').forEach(function(value){
if(![']', ',' , '['].includes(value)){
vals.push(value);
}
});
console.log(vals.join(','));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment