Skip to content

Array.lua v1.3.0

Compare
Choose a tag to compare
@EvandroLG EvandroLG released this 18 Dec 12:13
· 59 commits to master since this release

What's new from Array.lua v1.2.6?

  • Improved performance of diff method. It was working in quadratic time and now we're using a linear solution.

  • Added five new methods:

    • array.fill(value:*, [start:number], end:number):table

      Creates a table filling all the elements from a start index (default
      one) to an end index with a default value passed by parameter.

    • array.remove(object:table, callback:function):table

      Removes all elements from table that callback returns truthy for and returns a new table with the removed elements

    • array.counter(object:table):table

      Returns a new table in hash structure, where keys represent each array value

    • array.intersect(object:table, object:table):table

      Returns a new table with the values that exist in both tables

    • array.from_pairs(object:table, object:table):table

      Returns a table composed from key-value pairs