Skip to content

Tag: arrays

The frontend receives an array as [object Object]

I am building a website with JavaScript, express.js, ejs and Node.js and i just ran into a problem. I am sending an array to the frontend this way: And getting it on the frontend with ejs this way: If i print the array on the frontend the result will be [object Object] and I also printed out typeof(‘&lt…

How do you check for a type in an array?

I need to tell the program to search an array(that’s meant to be only numbers) if it contains any element that’s a string. Also, the array is made up of the arguments to a function. Can someone please help? I’ve been trying to figure this out for at least an hour! This is what i did so far: Answer You’r…