arr = [1, 2, 3, 4];

# length of array
println(length(arr));

# Dimensions in array

println(ndims(arr));
mat = [1 2; 3 4];
println(ndims(mat));

# Size of each Dimensions
println(size(mat));

# index range of each dimension

println(axes(mat));

# Array access methods

a1 = [1, 2, 3, 4];

# Push - append element to end of array
push!(a1, 5); # ! indicates that the object passed will be modified, no copy made
println(a1);

# Push First - append element to start of array
pushfirst!(a1, 0);
println(a1);

# Pop - remove last element from array
pop!(a1);
println(a1);

# Pop First - remove first element from array
popfirst!(a1);
println(a1);

# Insert at specified index
insert!(a1, 3, 6);
println(a1);

# Delete at specified index
deleteat!(a1, 3);
println(a1);

# Splice - like delete, but returns deleted element
splice!(a1, 3);
println(a1);

# Splice - can also be used as replacement
splice!(a1, 3, 6);
println(a1);

# Append - inserts at end of array
append!(a1, 5);
println(a1);

# Prepend - inserts at start of array
prepend!(a1, 0);
println(a1);

# Array operations

a = Int64[1, 2, 3, 4];
b = Int64[1, 2, 1, 1];

# Matrix operations
println(a + b);
println(a - b);
println(a / b);

c = [1 2 3 4];
println(a * c);

println(a == b);
println(a != b);

# Broadcasting

println(broadcast(*, a, b));
println(a .* b);
println(a .== b);