#1956 Is eqivalent map[key] = null and map.remove(key)?

Akcelisto Sun 15 Jul 2012

Is eqivalent map[key] = null and map.remove(key)?

Yuri Strot Sun 15 Jul 2012

No, map[key] = null doesn't remove a key, but sets value to null

map := [key: val]
map.remove(key)
echo(map.containsKey(key)) // false
map := Obj:Obj?[key: val]
map.set(key, null)
echo(map.containsKey(key)) // true

Login or Signup to reply.