openlang

CoffeeScript testing whether an array excludes someone

This small example tests whether a person belongs to the moderators. Instead, I need to test whether they are absent from that group.

if failure && member in staff
    return

My initial guess would look like this

if failure && member isnt in staff
    return

That plainly fails, though. How should I express this?

The conversation continues 2

Follow the reasoning
  1. Permalink

    CoffeeScript lets you express NOT with either ! or not

    if failure && !(member in staff)
    
    if failure && member not in staff

    both forms are valid.

Other sides of the same question

  1. Choosing enum entries randomly with GDScript in Godot 3.3 without listing each one?

    Here's the enum declaration I'm using in GDScript: I'd like to choose an enum variant randomly without listing every possible…

    Replies 2Latest activity gdscript
  2. Nim remainder syntax

    How is modulus expressed in Nim? cell % 7 == 0 gives undeclared identifier: '%' Neither a Google search nor looking through S…

    Replies 2Latest activity nim
  3. Returning results from an APL function

    How do I make my function return something once execution has finished? For instance, I have: ROUTINE N ? N ⍴ 12 //That gener…

    Replies 2Latest activity apl