Site menu

CodeCook.io

  • Languages
    • C
    • C++
    • CSS
    • Git
    • HTML
    • Java
    • JavaScript
    • jQuery
    • PHP
    • Python
    • Ruby
    • Scala
  • append
  • array

Scala - Append item to array

Add single item to the back of an array. Element is added to end of the array without altering the rest of the array. The length of the array increases by one.

0
1665
  • Share on Facebook
  • Share on Google+
  • Share on Twitter

Append and create new Sequence

{{array}} :+ {{item}}
java

Notes

  • Immutable: Append and create new Sequence

last update: Oct. 28, 2014

0
1620
  • Share on Facebook
  • Share on Google+
  • Share on Twitter
{{array}} += {{item}}
java

Notes

  • Mutable: Append ArrayBuffer

last update: Oct. 28, 2014

Advertisement

This project is hosted on DigitalOcean, try it and support us

Related concept

  • Get first element array
  • Find index of item in array
  • Concatenate two arrays
  • Sort list of numbers
  • Array length

Other language

  • Python
  • JavaScript
  • PHP

Random task

  • Change user
  • Object inner function
  • Array length
  • Filter Queryset on any of Django Q objects list
  • List existing tags
  • Blog
  • About
  • License