How to access the elements of a function's return array?

后端 未结 15 2248
栀梦
栀梦 2020-12-05 03:46

I need to return multiple values from a function, therefore I have added them to an array and returned the array.



        
15条回答
  •  无人及你
    2020-12-05 04:09

    The data function is returning an array, so you can access the result of the function in the same way as you would normally access elements of an array:

    Or you could use the list() function, as @fredrik recommends, to do the same thing in a line.

提交回复
热议问题