takeOrNull

Removes an attribute with the specified key and returns its current value, returns null if an attribute doesn't exist