vandelpavel commented on issue #18242:
URL: https://github.com/apache/echarts/issues/18242#issuecomment-2068799987
@minhnhat44 Be careful with your suggestion.
If the user/db uses a "dashed-name" it will break your logic, ex:
```ts
const name='dashed-name-id1';
const id=name.split('-'); // => "dashed"
```
If you want to use your workaround rather use something like this:
```ts
const name='dashed-name-id1';
const id=name.split('-').slice(-1); // => "id1"
const nameWithoutId=name.split('-').slice(0,-1).join('-'); // =>
"dashed-name"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]