Let’s practice what we’ve learned so far in the following exercises. Solutions to these exercises will be provided in the next lesson.
Problem 1
Create a function that concatenates two arrays into a new slice. Assume two input arrays of type int
that consist of data—for example, {1,2}
and {3,4,5,6}
, respectively. Then, write a concatenate()
function with suitable arguments that return a slice with contents {1,2,3,4,5,6}
.
Get hands-on with 1400+ tech skills courses.