insert

insert value in collection at given index


Parameters

insert collection :string :literal :dictionary :block
       index :integer :string
       value :any

Returns

  • :string
  • :dictionary
  • :block
  • or  :nothing

Examples

copy
insert [1 2 3 4] 0 "zero" ; => ["zero" 1 2 3 4] print insert "heo" 2 "ll" ; hello

copy
dict: #[ name: John ] insert 'dict 'name "Jane" ; dict: [name: "Jane"]

Related