mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-01-17 13:38:38 +01:00
[nix/en] document using ? to test set membership
This commit is contained in:
parent
7415df0077
commit
667cbfe2ba
@ -208,6 +208,12 @@ with builtins; [
|
|||||||
{ a = 1; b = 2; }.a
|
{ a = 1; b = 2; }.a
|
||||||
#=> 1
|
#=> 1
|
||||||
|
|
||||||
|
# The ? operator tests whether a key is present in a set.
|
||||||
|
({ a = 1; b = 2; } ? a)
|
||||||
|
#=> true
|
||||||
|
({ a = 1; b = 2; } ? c)
|
||||||
|
#=> false
|
||||||
|
|
||||||
# The // operator merges two sets.
|
# The // operator merges two sets.
|
||||||
({ a = 1; } // { b = 2; })
|
({ a = 1; } // { b = 2; })
|
||||||
#=> { a = 1; b = 2; }
|
#=> { a = 1; b = 2; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user