How do I take the first items out in a list in Haxe?
I am most used with the C# LINQ Take
, which I think is the same as javascript’s const slicedArray = array.slice(0, n);
(I don’t want to do it imperatively)
How do I take the first items out in a list in Haxe?
I am most used with the C# LINQ Take
, which I think is the same as javascript’s const slicedArray = array.slice(0, n);
(I don’t want to do it imperatively)
Yeah, I used saw that. I will be using Array
instead List
.
Is there a nice way convert between them, and any reason I shouldn’t completely use Array
?
Chances are that using Array
will be fine. There will be situations where List
gives better performance, but most of the time, you probably won’t be able to measure a difference.
What is the best way to convert from List<T>
to Array<T>
…?
Lambda.array(list);
or
using Lambda;
list.array();
© 2018-2020 Haxe Foundation - Powered by Discourse