Junho Choi Junho Choi - 2 years ago 54
HTML Question

Multiple functions one after the other in javascript

I am quite new to javascript so I wanted to ask a question because I find the question online.
In javascript, the syntax for functions is:

object.function();


I get an error when I try to make the function:

this.cell = hlist.shift().join(' ');


where hlist is an array, containing strings in each index

I am trying to remove the first element of the array and then create one whole string with what is left.

Thank you

Answer Source

You really have an XY question, here's the answer to what you're actually trying to accomplish:

this.cell = hlist.slice(1).join(' ');

Create a new array omitting the first element, and join it.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download