Navigation

    brainCloud Forums
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Solved
    • Unsolved
    • Users
    • Groups
    1. Home
    2. donate
    D
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    donate

    @donate

    0
    Reputation
    3
    Posts
    1
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    donate Follow

    Best posts made by donate

    This user hasn't posted anything yet.

    Latest posts made by donate

    • RE: Using numbers as JSON key.

      @JasonL
      Thank you!!

      posted in Cloud Code
      D
      donate
    • RE: Using numbers as JSON key.

      @Paul-Winterhalder
      actually i've tried "1" too.
      the result is
      sampleData[1] and sampleData["1"] are both OK,
      data[1] and data["1"] both returned Undefined.
      wondering why...

      posted in Cloud Code
      D
      donate
    • Using numbers as JSON key.

      hello, i did some experiment as below.
      i defined a sample data which is exactly the same as data inputed.
      wondering why data[1] returns "undefined" but sampleData[1] is OK?

      Input Parameters

      {
        "scriptName": "KeyTest",
        "scriptData": {
          "1": {"ID":1},
          "2": {"ID":2}
        }
      }
      

      Test Script

      // get log service
      var logService = bridge.getLogServiceProxy();
      
      var sampleData = {
          "1": {"ID":1},
          "2": {"ID":2}
        };
      logService.logInfoJson("sampleData" , sampleData);
      logService.logInfoJson("sampleData[1]" , sampleData[1]);
      
      logService.logInfoJson("data" , data);
      logService.logInfoJson("data[1]" , data[1]);
      

      result
      aeac7350-734f-4477-9ae3-43259d7a6a50-image.png

      posted in Cloud Code
      D
      donate