<script> var arr = [ "添加", "时候收到的哈哈哈", "啥开始看阿萨斯", "是好还是坏" ] var res= arr.map(item=>{ if(item.length>3){ item = item.substr(0,3)+"..." } return item }); console.log(res) </script>