JSFiddle - React, Tailwind, and code Playground

by saidulu401

JavaScript

var ops=[{label: 'Primary Colors',
options: [{label: 'Yellow',value: 'yellow'},
{label: 'Red',value: 'red'},
{label: 'Blue',value: 'blue'}]},
{label: 'Secondary Colors',
options: [{label: 'Pink',value: 'yellow'},{label: 'Pink',value: 'Pink'},{label: 'Violet',value: 'violet'}]}];      

var arr =[];var obj = [];
arr = ops.forEach(function(o){
  var a = o.options;
  a.forEach(function(option) {
    console.log(option.value);
    obj.push(option.value);
	});
});
console.log(obj);