• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by dansav · Dec 13, 2013 at 05:06 AM · javascriptarraysstringcsbuiltin

how do you make a javascript built in string array

I'm trying to convert some cs code to javascript

var productIdentifiers = new string[] { "200c", "500c", "1000c"};

I've tried this
var productIdentifiers = ["200c","500c","1000c"];

but it doesn't seem to work the same for some reason. In the unify wiki on which arrays to use it implies they should be equivalent.

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Eric5h5 · Dec 13, 2013 at 05:12 AM 1
Share

It does work the same; why do you think it doesn't?

avatar image dansav · Dec 13, 2013 at 06:00 AM 0
Share

I have some CS code from prime31 storekit that asks for a string array which it uses in a call Store$$anonymous$$itBinding.RequestProductData(productIdentifiers);

That function takes a string array and uses join to turn it into a regular string. In the javascript case it sends in "" but in the CS case it sends in the string "1000c,200c,500c" at least I think it does after reading the debugs.

avatar image Eric5h5 · Dec 13, 2013 at 06:05 AM 0
Share

You'd have to post more code, since what you have here is equivalent to the C# version.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

17 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

c# string script to javascirpt? 1 Answer

Pushing GameObject into JS Array returns NullReferenceException 1 Answer

Access a GameObject through it's tag, using a string. 1 Answer

Using arrays and for loop with GetComponent error 1 Answer

Why can't I push and pop from string array? 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges