javascript array trim using length code example Example: javascript truncate array array.slice(0, 4);