JSFiddle - React, Tailwind, and code Playground
JavaScript
let langSupport = ['en-US', 'ja-JP', 'zh-CN', 'es-ES', 'de-DE', 'fr-FR'];
let searchFilter = ['content', 'highlight', 'note', 'pagenote'];
let obj = {};
langSupport.forEach(function(locale) {
let prefixfn = `searchContent${locale}`;
searchFilter.forEach(function(type) {
obj[`${locale}_${type}`] = `searchContent${locale}["searchBookPages"]`
});
});
console.log(obj);