JavaScript, 28 bytes f=n=>n-1&&-~f(n%2?n*3+1:n/2) Try it online!
posted 3y ago by Shaggy
# JavaScript, 28 bytes <!-- language-all: lang-javascript --> f=n=>n-1&&-~f(n%2?n*3+1:n/2) [Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/f8/zTbP1i5P11BNTbcuTSNP1cg@T8tY29AqT99I839yfl5xfk6qXk5@uka0oY6RjrGOiY6pjpmOuY6FjqWOoUGsXm5igUaapuZ/AA)