How to treat a string as a vector in javascript
The title sums up the question, but here's the long story: I'm doing small projects for myself to a. learn new stuff along the way. b. to figure out what is possible and what is not. I've set out to make a "self-marketing gallery/website for a painter". I split up the webpage into 9 grid boxes (navbar, 6 mini boxes, main content box, and a footer). The 6 mini-boxes is set to display: flex, left side is occupied by a painting, which is blurred and on hover expands and becomes clear. On the right I wanted a description of the painting, but done with a typewriter effect. Now there are many solutions I found on the internet, but I've had trouble making them work and even if i did, I prefer to figure out a solution of my own, to see how I would tackle this problem instinctively. In c++ I learned that a string is a sort of a vector of letters and can be treated as a vector. So, my idea is to do the same in javascript, hence a loop that itirates through the string(a vector), adds one character, makes a | symbol appear and dissappear and then adds the next letter and when the text is finished loops | symbol on repeat. Now the immideate problem I encountered is that unlike c++ a string is not a vector in javascript, hence the question