Skip to content

distance

SuperPhantomUser edited this page Jun 11, 2021 · 1 revision

Distance

The distance method returns the distance between 2 items, INCLUDING the second item.

Array types: 1d
Returns: integer

Arguments:

  • array
  • first item
  • second item

Examples:

const array = ["a", "b", "c", "d"];
console.log(Arrays.distance(array, "a", "b"));
// Returns: 1
const array = ["a", "b", "c", "d"];
console.log(Arrays.distance(array, "a", "d"));
// Returns: 3

Clone this wiki locally