Skip to content

Instantly share code, notes, and snippets.

@shawnr
Created May 13, 2014 23:12
Show Gist options
  • Save shawnr/bf17930340ed30ea2464 to your computer and use it in GitHub Desktop.
Save shawnr/bf17930340ed30ea2464 to your computer and use it in GitHub Desktop.
Quick script parts to determine if a Canvas LMS user ID is in a list of IDs
var id_list = [
1234,
4321
];
var id_string = id_list.join(' ');
if (id_string.indexOf(ENV.current_user_id) > -1) {
console.log('user found in admins');
} else {
console.log('user not found in admins');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment