var roles = ['1', '2', '3', '4', '5'] var route = { role: ['3', '4'] } function hasPermission(roles, route) { route.indexOf(' } alert('aaaa ')'