Created
March 9, 2020 06:43
-
-
Save KantaPaul/aef96043cf09d358557bbb5a7ed7f98a to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/bonuhiv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
let arr = [ | |
{ | |
post_data: { | |
tag: 'hello , world' | |
} | |
}, | |
{ | |
post_data: { | |
tag: 'joy , bangla' | |
} | |
}, | |
{ | |
post_data: { | |
tag: 'hello , foo' | |
} | |
} | |
] | |
let newarr = []; | |
arr.map((value, index) => { | |
return newarr.push(value.post_data.tag) | |
}) | |
let joinvalue = newarr.join(', '); | |
let replacevalue = joinvalue.replace(/[^a-zA-Z ]/g, ""); | |
let spilitvalue = replacevalue.split(' ') | |
let removeclone = spilitvalue.filter((value, index, arr) => { | |
return arr.indexOf(value) === index; | |
}) | |
let removeemptyspace = removeclone.filter((value) => { | |
return value !== ""; | |
}) | |
console.log(removeemptyspace) | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">let arr = [ | |
{ | |
post_data: { | |
tag: 'hello , world' | |
} | |
}, | |
{ | |
post_data: { | |
tag: 'joy , bangla' | |
} | |
}, | |
{ | |
post_data: { | |
tag: 'hello , foo' | |
} | |
} | |
] | |
let newarr = []; | |
arr.map((value, index) => { | |
return newarr.push(value.post_data.tag) | |
}) | |
let joinvalue = newarr.join(', '); | |
let replacevalue = joinvalue.replace(/[^a-zA-Z ]/g, ""); | |
let spilitvalue = replacevalue.split(' ') | |
let removeclone = spilitvalue.filter((value, index, arr) => { | |
return arr.indexOf(value) === index; | |
}) | |
let removeemptyspace = removeclone.filter((value) => { | |
return value !== ""; | |
}) | |
console.log(removeemptyspace)</script></body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let arr = [ | |
{ | |
post_data: { | |
tag: 'hello , world' | |
} | |
}, | |
{ | |
post_data: { | |
tag: 'joy , bangla' | |
} | |
}, | |
{ | |
post_data: { | |
tag: 'hello , foo' | |
} | |
} | |
] | |
let newarr = []; | |
arr.map((value, index) => { | |
return newarr.push(value.post_data.tag) | |
}) | |
let joinvalue = newarr.join(', '); | |
let replacevalue = joinvalue.replace(/[^a-zA-Z ]/g, ""); | |
let spilitvalue = replacevalue.split(' ') | |
let removeclone = spilitvalue.filter((value, index, arr) => { | |
return arr.indexOf(value) === index; | |
}) | |
let removeemptyspace = removeclone.filter((value) => { | |
return value !== ""; | |
}) | |
console.log(removeemptyspace) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment