1<div id="root">
2</div>
3<script type="text/es2015">
4function MyFunction() {
5 var myArray = ['100', '120', '130', '140', '500', '100', '120', '140'];
6
7 var result = [];
8 result = myArray.filter(function(item, pos, self) {
9 return self.indexOf(item) == pos;
10})
11 var items = result.map((item) =>
12 item+','
13);
14 return (
15 <p>{items}</p>
16 );
17}
18
19ReactDOM.render(
20 <MyFunction />,
21 document.getElementById('root')
22);
23</script>
24