Guru's Verification engine ensures consistency, confidence, and trust in the knowledge your organization shares. Learn more.

Julia | Adding elements to arrays

You can add elements to arrays either destructively, or not:

Non-destructive:

a = [1, 2, 3]b = [a; 4] # b is [1, 2, 3, 4]

Destructive:

a = [1, 2, 3]push!(a, 4) # a is [1, 2, 3, 4]

Resources:

You must have Author or Collection Owner permission to create Guru Cards. Contact your team's Guru admins to use this template.