(other: Array<string> | string, position = 1, options?: { inplace?: boolean })
| 194 | */ |
| 195 | concat(other: Array<string> | string, position: number, options?: { inplace?: boolean }): Series |
| 196 | concat(other: Array<string> | string, position = 1, options?: { inplace?: boolean }): Series | void { |
| 197 | const { inplace } = { inplace: false, ...options } |
| 198 | const newArr: Array<string | number> = []; |
| 199 | |
| 200 | if (Array.isArray(other)) { |
| 201 | for (let i = 0; i < other.length; i++) { |
| 202 | let leftStr = `${this.values[i]}`; |
| 203 | let rightStr = `${other[i]}`; |
| 204 | if (position == 1) { |
| 205 | newArr.push(leftStr.concat(rightStr)); |
| 206 | } else { |
| 207 | newArr.push(rightStr.concat(leftStr)); |
| 208 | } |
| 209 | |
| 210 | } |
| 211 | } else { |
| 212 | this.values.map((val) => { |
| 213 | if (position == 1) { |
| 214 | if (utils.isEmpty(val)) { |
| 215 | newArr.push(NaN); |
| 216 | } else { |
| 217 | newArr.push(`${val}`.concat(`${other}`)); |
| 218 | } |
| 219 | |
| 220 | } else { |
| 221 | if (utils.isEmpty(val)) { |
| 222 | newArr.push(NaN); |
| 223 | } else { |
| 224 | newArr.push(other.concat(`${val}`)); |
| 225 | } |
| 226 | } |
| 227 | }); |
| 228 | } |
| 229 | |
| 230 | if (inplace) { |
| 231 | this.series.$setValues(newArr as ArrayType1D) |
| 232 | this.series.print() |
| 233 | } else { |
| 234 | const sf = this.series.copy() |
| 235 | sf.$setValues(newArr as ArrayType1D) |
| 236 | return sf; |
| 237 | } |
| 238 | |
| 239 | } |
| 240 | |
| 241 | |
| 242 | /** |
no test coverage detected