ninja code best practices on js