node.js - Concat String to Int in Javascript -


i've come across rather annoying little syntax problem. i'm using scissors node module handling pdf files.

the syntax choosing of pdfs pages described in docs:

var scissors = require('scissors'); var pdf = scissors('in.pdf')    .pages(4, 5, 6, 1, 12) 

this works great me, i'd dynamically. how go concatenating integers commas in javascript? if pass string, function doesn't work anymore.

thanks lot in advance

you passing n values arguments function. if concatenate string pass 1 argument, concatenated string.

probably want use spread operator https://developer.mozilla.org/en-us/docs/web/javascript/reference/operators/spread_operator

if have numbers array want pass them function this:

var scissors = require('scissors'); var pages = [4, 5, 6, 1, 12]; var pdf = scissors('in.pdf')    .pages(...pages); 

Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -