Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#Use & to check if an item is in a list

Use & to check if an item is in a list

For

1 [1 2 3] #W>
1 [1 2 3] #)

You can use

1 [1 2 3] &,
1 [1 2 3] &

instead, which returns 0/1 and truthy/falsey respectively.

#Use & to check if an item is in a list

For

1 [1 2 3] #W>
1 [1 2 3] #)

You can use

1 [1 2 3] &,
1 [1 2 3] &

instead, which returns 0/1 and truthy/falsey respectively.

Use & to check if an item is in a list

For

1 [1 2 3] #W>
1 [1 2 3] #)

You can use

1 [1 2 3] &,
1 [1 2 3] &

instead, which returns 0/1 and truthy/falsey respectively.

Source Link
jimmy23013
  • 37.4k
  • 6
  • 79
  • 154

#Use & to check if an item is in a list

For

1 [1 2 3] #W>
1 [1 2 3] #)

You can use

1 [1 2 3] &,
1 [1 2 3] &

instead, which returns 0/1 and truthy/falsey respectively.

AltStyle によって変換されたページ (->オリジナル) /