So, I have a function, and I'd like it to return multiple variables. To do that however, it seems like I need to run the function twice. E.g.
console.log( textCleanup(text,true,true,true,true,true,true)[0] )
console.log( textCleanup(text,true,true,true,true,true,true)[1] )
Now, I figured, I can just define the variables beyond the function, and have the function change them, then I don't need to run it twice. But, is it safe? I haven't been programming for very long and I feel like I night be missing information about how it all works, and to me it feels like maybe this isn't how this should be done. Would appreciate any info on this. I tried googling it, but I suppose I wasn't googling for the right terms, as I haven't found much about it.
Via Active questions tagged javascript - Stack Overflow https://ift.tt/2qp0xyK
Comments
Post a Comment