Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Call function with variable array

The function works fine when calling like this.

 GenColumns({columns: [
 { headerText: "ID"},
 { headerText: "Doc"},
 { headerText: "Customer ID"}
 ] }]

But if I change to this, it doesn’t work.

 var col = [{ headerText: " ID", key: "D"},
 { headerText: "Doc"},
 { headerText: "Customer ID"}
 ];
 GenColumns({columns: [
 col
 ] })

How can I call function passing a generated string because "col" variable will be generated and does not type manually?

Thanks Wilson

Answer*

Draft saved
Draft discarded
Cancel
0

lang-js

AltStyle によって変換されたページ (->オリジナル) /