Created
January 5, 2019 15:11
-
-
Save andreleoni/e5374c32396f4fc091b8251c7fe97432 to your computer and use it in GitHub Desktop.
medium post complex references
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cria o objeto | |
object = { a: 1, b: 2 } | |
=> {:a=>1, :b=>2} | |
# Cria a referência | |
reference = object | |
=> {:a=>1, :b=>2} | |
# Deleta o objeto da referência | |
reference.delete(:a) | |
=> 1 | |
# Imprimi a variável do objeto | |
object | |
=> {:b=>2} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment