Here is my code
function gotData(data){
result = data.val()
const urls_kws = Object.keys(result)
.filter(key => result[key].last_res > 10)
var keywords = urls_kws;
console.log(urls_kws)
for(var i=0;i<keywords.length;i++) {
keywords[i] = keywords[i].replace(/-/gi, " " )
}
}
Result is
[ '7-skinfood-gold-caviar-collagen-cream',
'beauty-credit']
But when i move console.log(urls_kws) to below
function gotData(data){
result = data.val()
const urls_kws = Object.keys(result)
.filter(key => result[key].last_res > 10)
var keywords = urls_kws;
for(var i=0;i<keywords.length;i++) {
keywords[i] = keywords[i].replace(/-/gi, " " )
}
console.log(urls_kws)
}
Result is
[ '7 skinfood gold caviar collagen cream',
'beauty credit']
My question is how can i keep value on urls_kws
because i need to use both of var urls_kws(with -) and keywords(without -)
via Moomoo Soso
No comments:
Post a Comment