PositionLast

Description

Search last occurrence

Inputs

  • MyString
  • FindMe

Outputs

  • Position FindMe of MyString

Algorithm

/**
 * PositionLast: Search last occurrence
 *
 * @param x1 MyString
 * @param x2 FindMe
 * @return {Array}
 */
function neuron581(x1, x2)
{
return [x1.toString().lastIndexOf(x2)];
}

console.log(neuron581(438, 810));

Create your family tree for free