From 88f89bde4e77ac702e4f811902b72424a33e4c18 Mon Sep 17 00:00:00 2001 From: Artem Yurchenko Date: Sun, 9 Apr 2023 13:43:13 +0200 Subject: [PATCH] doc: improve `in` documentation for maps (#17918) --- doc/docs.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/docs.md b/doc/docs.md index af13e8cbee..1b56ea188b 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -1762,10 +1762,17 @@ To do the opposite, use `!in`. nums := [1, 2, 3] println(1 in nums) // true println(4 !in nums) // true +``` + +> **Note** +> `in` checks if map contains a key, not a value. + +```v m := { 'one': 1 'two': 2 } + println('one' in m) // true println('three' !in m) // true ```