unshiftObject (obj) public
Unshift an object to start of array. Works just like unshift()
but it is KVO-compliant.
let colors = ['red']; colors.unshiftObject('yellow'); // ['yellow', 'red'] colors.unshiftObject(['black']); // [['black'], 'yellow', 'red']
Parameters:
-
obj
*
- object to unshift
Returns:
- object same object passed as a param
Please login to continue.