# JavaScript (ES6), 87 bytes

Expects and returns `-1` for Fizz, `-2` for Buzz, `-3` for FizzBuzz.

<!-- language-all: lang-javascript -->

 f=(a,k=0)=>[...b=a.sort().map(_=>++i%3?i%5?i:-2:i%5?-1:-3,i=k)].sort()+''==a?b:f(a,k+1)

[Try it online!][TIO-l4ytlzbc]

[JavaScript (Node.js)]: https://nodejs.org
[TIO-l4ytlzbc]: https://tio.run/##VY9ta8IwFIW/91dcBElC02DbDbUjCoP5B/zYicSauswudUkdzJff3jV9YduX5J7DyXNu3sWXsJlRpyrQ5V7Wdc6xoEc@IXyRMsZ2XDBbmgoT9iFOeMsXvq/G8VKNH5cqCaLEDUGYBDFV/Eg2fdhHiHOx3CW5o/khqY38PCsjMcotIsxIsV@pQq6/dYYnhFXlujJKH5oaeypUhUevekRYXpoXkb1hC3wBVw@gkBUI4GD7GKKAus3aCL6u1OWSQBBSeD63U0TBeb2K7yS1G7jdwLfkqQFmpbZlIVlRHnCza8fSjpWi4Z0rGW7noU2qwYe45WjScO6kbhr7KgoPXbv3T1Fwkd7rzt4Ovb9yNgzTLuZ1qh2jOYU4/P2RF80G1mA1HXOvcac/ "JavaScript (Node.js) – Try It Online"