It appears that using i -= i.headdoes not perform the same function as i.remove(0) on a ListBuffer. Is that right. If so why?
Scala: Can I use -= head to remove an item from a list?
303 views Asked by finsysvlogger At
1
It appears that using i -= i.headdoes not perform the same function as i.remove(0) on a ListBuffer. Is that right. If so why?
i -= i.headreturns the modifiedListBuffer.i.remove(0)returns the element removed from theListBuffer.The resulting modified
ListBufferis the same in either case.