prepends elem to the value of s, and resets s to the result.
- PrependTo[s,elem] is equivalent to s=Prepend[s,elem].
- PrependTo has attribute HoldFirst.
- You can use PrependTo repeatedly to build up a list, though Sow and Reap will usually be more efficient. »
- PrependTo works on SparseArray objects, returning ordinary lists if necessary. »
- PrependTo works on Association objects, just like Prepend.
Examplesopen all close all
Basic Examples (2)
Prepend to an Association:
Generalizations & Extensions (2)
Possible Issues (4)
Introduced in 1988Updated in 2014