Is there any programming language that can return multiple arrays?
By that I mean something like
return array[0..100]
If you can name it I'll learn that.
Is there any programming language that can return multiple arrays?
Javascript
common lisp allows for multiple return values
1. your code snippet only returns a single array.
2. yes languages that can return tuples. (and i think also go)
in c# you could do something like this:
return (array1, array2);
return [[1,2,3], [2,3,4]]
Would that return 100 arrays or two though?
Should be possible in any (non meme) language. Just make an array of arrays
In most languages you can just return a tuple with mutiple arrays, or arrays of arrays
your question is written stupidly
but anyway python
The tuple example returns 2 arrays...๐
>ARE THERE ANY LANGUAGES WITH SYNTACTICAL SUGAR IMPLEMENTING SOMETHING THAT CAN BE ACHIEVED THROUGH A SHORT FUNCTION
๐ฃ
checked
Go has multiple return values, including of different types, as an explicit feature. Python's tuple creation and destructuring makes it more or less look like it has that too. You can just return arbitrary arrays in dynamically typed languages anyway.
/thread
return [ [ 1,2 ], [3, 4] ]
good job wojak. you got the cylinder lined up with the whole
golang
k){(!x;!y)}[69;420]
...
Python
?? in what meme language is it not possible ๐ฒ
C, just return a pointer to a multidimensional array
Umm sweetie, thatโs a 2d array