mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00: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
|
||||
#=> 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.
|
||||
({ a = 1; } // { b = 2; })
|
||||
#=> { a = 1; b = 2; }
|
||||
|
Loading…
Reference in New Issue
Block a user