Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Accessing any string type element inserted within multiple arrays

Suppose I have an array:

let x = [[["3"]]];

I can access easily to the inserted element without using object notation by simply writing

parseInt(x); // 3

But if we

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

let x = [[["a"]]];

There is no number within multiple arrays in x, so how can we access ("a") directly in one step, like parseInt() for above situation. Is there any way, then suggest?

>Solution :

You can use toString function for that

console.log([[["a"]]].toString());
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading