1. <script>
    2. var str =" hello ";
    3. var arr = [];
    4. arr.push(str.trim());
    5. console.log(arr); //["hello"]
    6. </script>