I tried to filter an ArraySlice<Float>
to replace the values below -5000 and higher 5000 to -5000 and 5000.
I can apply one condition but how I can apply both condition in a same time?
I want to add that if the value is higher than 5000, replace it with 5000, how I can do that?
filteredData.append(contentsOf: data.map({ return $0 < -5000 ? -5000 : $0}))