on 2021 Aug 31 3:28 PM
Hi Experts,
we have a use case where we need to delete elements in an array and currently, we are using the splice() method to delete but we are getting this error saying that splice is not a function

the error we are getting is :

do we need to import any library to use the array functions? or are we doing anything wrong syntax-wise?
our use case is we have a string with us and we have an array of elements
ex: str = "TELANGANA";
states = ["TELANGANA","DELHI","ASSAM"];
we have to delete the str TELANGANA from the states array and after updating it should look like
states => [DELHI,ASSAM]
we also checked with remove/delete and getting the error,
how to delete the string element in an array?
whereas it's working fine in our browser console

but it is not working in CDC
Can you please help
Thanks
Kishore
Request clarification before answering.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.