const a = [{label:'Accommodation and Food Services',value:'Accommodation and Food Services',children:[{label:'Bed and Breakfast inns',value:'Bed and Breakfast inns'},{label:'Hotels and motels',value:'Hotels and motels'},{label:'Recreational and vacation camps and parks',value:'Recreational and vacation camps and parks',},{label:'Rooming and boarding houses',value:'Rooming and boarding houses',},{label:'Casino hotels, restaurants, and drinking establishments',value:'Casino hotels, restaurants, and drinking establishments',},],},{label:'Administrative, Support, Waste Management, and Remediation Services',value:'Administrative, Support, Waste Management, and Remediation Services',children:[{label:'Administrative and support services (for example, employment services)',value:'Administrative and support services (for example, employment services)',},{label:'Court reporting and stenotype services',value:'Court reporting and stenotype services',},{label:'Exterminating and pest control services',value:'Exterminating and pest control services',},{label:'Investigation and security services',value:'Investigation and security services',},{label:'Landscaping services',value:'Landscaping services'},{label:'Locksmiths',value:'Locksmiths'},{label:'Materials recovery facilities',value:'Materials recovery facilities',},{label:'Septic tank and related services',value:'Septic tank and related services',},{label:'Waste collection',value:'Waste collection'},{label:'Waste treatment and disposal',value:'Waste treatment and disposal',},{label:'Travel agencies, auctioneers, and telemarketers',value:'Travel agencies, auctioneers, and telemarketers',},],},{label:'Agriculture, Forestry, Fishing, and Hunting',value:'Agriculture, Forestry, Fishing, and Hunting',children:[{label:'Animal production',value:'Animal production'},{label:'Crop production',value:'Crop production'},{label:'Fishing, hunting, and trapping',value:'Fishing, hunting, and trapping',},{label:'Forestry and logging',value:'Forestry and logging'},{label:'Support activities in agriculture and forestry',value:'Support activities in agriculture and forestry',},],},{label:'Arts, Entertainment, and Recreation',value:'Arts, Entertainment, and Recreation',children:[{label:'Agents and managers for artists, athletes, entertainers, and other public figures',value:'Agents and managers for artists, athletes, entertainers, and other public figures',},{label:'Amusement and recreation industries (for example, golf courses and country clubs)',value:'Amusement and recreation industries (for example, golf courses and country clubs)',},{label:'Bowling centers',value:'Bowling centers'},{label:'Fitness and recreational sports centers',value:'Fitness and recreational sports centers',},{label:'Marinas',value:'Marinas'},{label:'Museums, historical sites, and similar institutions (for example, zoos and botanical gardens)',value:'Museums, historical sites, and similar institutions (for example, zoos and botanical gardens)',},{label:'Performing arts, spectator sports, related industries, and promoters of these industries',value:'Performing arts, spectator sports, related industries, and promoters of these industries',},{label:'Casinos, card clubs, and gaming of any kind',value:'Casinos, card clubs, and gaming of any kind',},],},{label:'Construction',value:'Construction',children:[{label:'All types of building construction',value:'All types of building construction',},{label:'All types of specialty trade contractors',value:'All types of specialty trade contractors',},{label:'Heavy and civil engineering construction',value:'Heavy and civil engineering construction',},],},{label:'Educational Services',value:'Educational Services',children:[{label:'All other schools and instruction',value:'All other schools and instruction',},{label:'Colleges, universities and professional schools',value:'Colleges, universities and professional schools',},{label:'Elementary and secondary schools',value:'Elementary and secondary schools',},{label:'Junior colleges',value:'Junior colleges'},{label:'Technical and trade schools',value:'Technical and trade schools',},{label:'Flight training schools',value:'Flight training schools'},],},{label:'Finance and Insurance',value:'Finance and Insurance',children:[{label:'Commodity contracts, other financial investments, and related activities',value:'Commodity contracts, other financial investments, and related activities',},{label:'Funds, trusts, and other financial vehicles',value:'Funds, trusts, and other financial vehicles',},{label:'Insurance carriers and related activities',value:'Insurance carriers and related activities',},{label:'MBSs (money service businesses), pawnshops, deposit and investment brokers, securities brokers and dealers, investment advisory and investment banking services, payday and unsecured loans',value:'MBSs (money service businesses), pawnshops, deposit and investment brokers, securities brokers and dealers, investment advisory and investment banking services, payday and unsecured loans',},],},{label:'Health Care and Social Assistance',value:'Health Care and Social Assistance',children:[{label:'Child day care services',value:'Child day care services'},{label:'Community food and housing',value:'Community food and housing',},{label:'Emergency and other relief services',value:'Emergency and other relief services',},{label:'Hospitals',value:'Hospitals'},{label:'Medical laboratories',value:'Medical laboratories'},{label:'Outpatient care Centers',value:'Outpatient care Centers'},{label:'Residential care facilities',value:'Residential care facilities',},],},{label:'Information',value:'Information',children:[{label:'All other information services',value:'All other information services',},{label:'Broadcating',value:'Broadcating'},{label:'Data processing services',value:'Data processing services'},{label:'Internet publishing and broadcasting',value:'Internet publishing and broadcasting',},{label:'Internet service providers',value:'Internet service providers',},{label:'Motion picture and sound recording industries',value:'Motion picture and sound recording industries',},{label:'Publishing industries',value:'Publishing industries'},{label:'Telecommunications',value:'Telecommunications'},{label:'Web search portals',value:'Web search portals'},{label:'Social media platform',value:'Social media platform'},],},{label:'Management of Companies and Enterprises',value:'Management of Companies and Enterprises',children:[{label:'Corporate, subsidiary, and regional managing offices',value:'Corporate, subsidiary, and regional managing offices',},{label:'offices of bank holding companies',value:'offices of bank holding companies',},{label:'offices of other holding companies',value:'offices of other holding companies',},],},{label:'Manufacturing',value:'Manufacturing',children:[{label:'All types of food manufacturing',value:'All types of food manufacturing',},{label:'Apparel manufacturing',value:'Apparel manufacturing'},{label:'Chemical manufacturing',value:'Chemical manufacturing'},{label:'Computer and electronic product manufacturing',value:'Computer and electronic product manufacturing',},{label:'Electrical equipment, appliance, and component manufacturing',value:'Electrical equipment, appliance, and component manufacturing',},{label:'Fabricated metal product manufacturing',value:'Fabricated metal product manufacturing',},{label:'Furniture and related product manufacturing',value:'Furniture and related product manufacturing',},{label:'Machinery manufacturing',value:'Machinery manufacturing'},{label:'Paper manufacturing',value:'Paper manufacturing'},{label:'Petroleum and coal products manufacturing',value:'Petroleum and coal products manufacturing',},{label:'Plastics and rubber products manufacturing',value:'Plastics and rubber products manufacturing',},{label:'Printing and related support activities',value:'Printing and related support activities',},{label:'Textile mills',value:'Textile mills'},{label:'Transportation equipment manufacturing',value:'Transportation equipment manufacturing',},{label:'Wood products',value:'Wood products'},{label:'Machine parts manufacturers, weapon and ammunition manufacturers, and chemical manufacturers',value:'Machine parts manufacturers, weapon and ammunition manufacturers, and chemical manufacturers',},],},{label:'Mining, Quarrying, and Oil and Gas Extraction',value:'Mining, Quarrying, and Oil and Gas Extraction',children:[{label:'Coal mining and all other metal ore mining',value:'Coal mining and all other metal ore mining',},{label:'Oil and gas extraction',value:'Oil and gas extraction'},{label:'Support activities for mining',value:'Support activities for mining',},],},{label:'Other Services',value:'Other Services',children:[{label:'All types of repair and maintenance',value:'All types of repair and maintenance',},{label:'Personal and laundry services',value:'Personal and laundry services',},{label:'Private households',value:'Private households'},{label:'Religious, civic, professional,and similar organizations',value:'Religious, civic, professional,and similar organizations',},{label:'Car washes, parking garages, trade union activities, nonprofit organisations, not-for-profit organisations and other charitable organisations',value:'Car washes, parking garages, trade union activities, nonprofit organisations, not-for-profit organisations and other charitable organisations',},],},{label:'Professional, Scientific and Technical Services',value:'Professional, Scientific and Technical Services',children:[{label:'Accounting tax preparation bookkeeping, and payroll services',value:'Accounting tax preparation bookkeeping, and payroll services',},{label:'Advertising and related services',value:'Advertising and related services',},{label:'Architectural, engineering, and related services',value:'Architectural, engineering, and related services',},{label:'Legal services',value:'Legal services'},{label:'Management, scientific and technical consulting services',value:'Management, scientific and technical consulting services',},{label:'Specialized design services',value:'Specialized design services',},{label:'Lawyers, title insurance companies, and accountants',value:'Lawyers, title insurance companies, and accountants',},],},{label:'Public Administration',value:'Public Administration',children:[{label:'Administrative of other public programs',value:'Administrative of other public programs',},{label:'Executive, legislative, and other general government support',value:'Executive, legislative, and other general government support',},{label:'Justice public order, and safety Activities',value:'Justice public order, and safety Activities',},],},{label:'Real Estate and Rental Leasing',value:'Real Estate and Rental Leasing',children:[{label:'All types of rental and leasing services (for example, vehicles, consumer goods, and commercial and industrial machinery and equipment)',value:'All types of rental and leasing services (for example, vehicles, consumer goods, and commercial and industrial machinery and equipment)',},{label:'Lessors of real estate property, including residential and nonresidential buildings, mini-warehouses, and selfstorage units',value:'Lessors of real estate property, including residential and nonresidential buildings, mini-warehouses, and selfstorage units',},{label:'Offices of real estate agents and brokers, property managers, and appraisers',value:'Offices of real estate agents and brokers, property managers, and appraisers',},{label:'Real estate brokerages',value:'Real estate brokerages'},],},{label:'Retail Trade',value:'Retail Trade',children:[{label:'Aircraft boats, and mobile home dealers',value:'Aircraft boats, and mobile home dealers',},{label:'Building material, garden and farm equipment, and supply dealers',value:'Building material, garden and farm equipment, and supply dealers',},{label:'Direct-selling establishments',value:'Direct-selling establishments',},{label:'Electronics and appliance stores',value:'Electronics and appliance stores',},{label:'Food and beverage stores',value:'Food and beverage stores'},{label:'Furniture and home furnishing stores',value:'Furniture and home furnishing stores',},{label:'Gasoline stations',value:'Gasoline stations'},{label:'General merchandise stores and miscellaneous store retailers',value:'General merchandise stores and miscellaneous store retailers',},{label:'Health and personal care stores',value:'Health and personal care stores',},{label:'Jewel, gem, and precious metal dealers',value:'Jewel, gem, and precious metal dealers',},{label:'Leather goods',value:'Leather goods'},{label:'Motor vehicle and parts dealers',value:'Motor vehicle and parts dealers',},{label:'Nonstore retailers (for example, electronic and mail-order houses)',value:'Nonstore retailers (for example, electronic and mail-order houses)',},{label:'Sporting goods, hobby, book, and music stores',value:'Sporting goods, hobby, book, and music stores',},{label:'Commercial clothing, footwear and accessories',value:'Commercial clothing, footwear and accessories',},{label:'E-Commerce & Online Auctions',value:'E-Commerce & Online Auctions',},{label:'All other retail goods',value:'All other retail goods'},],},{label:'Transportation and Warehousing',value:'Transportation and Warehousing',children:[{label:'Air, rail, truck, transit, and ground passenger transportation',value:'Air, rail, truck, transit, and ground passenger transportation',},{label:'All types of warehousing and storage',value:'All types of warehousing and storage',},{label:'Couriers and messengers',value:'Couriers and messengers'},{label:'Pipeline transportation',value:'Pipeline transportation'},{label:'Postal service',value:'Postal service'},{label:'Scenic and sightseeing transportation',value:'Scenic and sightseeing transportation',},{label:'Support Activities for all types of transportation',value:'Support Activities for all types of transportation',},],},{label:'Utilities',value:'Utilities',children:[{label:'All types of electric power generation transmission, and distribution',value:'All types of electric power generation transmission, and distribution',},{label:'Natural gas distribution',value:'Natural gas distribution'},{label:'Water sewage and other systems',value:'Water sewage and other systems',},],},{label:'Wholesale Trade',value:'Wholesale Trade',children:[{label:'Merchant wholesalers of all types of durable and nondurable goods',value:'Merchant wholesalers of all types of durable and nondurable goods',},],},];
const b = [];
const test = (data, parent) => {
if (data.children.length) {
return test(data.children, data.label);
} else {
data.label = `${parent}+${data.label}`
b.push(data.label)
return data.label;
}
}
test(a, '');
console.log(b);