Get function is return one element with the index of array
(index int)
| 65 | |
| 66 | // Get function is return one element with the index of array |
| 67 | func (da *DynamicArray) Get(index int) (any, error) { |
| 68 | err := da.CheckRangeFromIndex(index) |
| 69 | |
| 70 | if err != nil { |
| 71 | return nil, err |
| 72 | } |
| 73 | |
| 74 | return da.ElementData[index], nil |
| 75 | } |
| 76 | |
| 77 | // IsEmpty function is check that the array has value or not |
| 78 | func (da *DynamicArray) IsEmpty() bool { |