Skip to content

Commit

Permalink
Remove the word 'primitive'
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Roberts committed Aug 22, 2017
1 parent cc15add commit 289c40a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 02-intermediate-ruby/references-and-values.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ modify_string(text)
puts "outside modify_string, text is '#{text}'"
```

Primitive types like numbers, booleans and `nil` follow basically the same rules. The catch is there's no way to change the underlying value of a primitive without reassignment. In programming lingo, we say that these types are _immutable_. This means that whenever you change the value, Ruby makes a copy and changes that instead.
Small, built-in types like numbers, booleans and `nil` follow basically the same rules. The catch is there's no way to change the underlying value of these types without reassignment. In programming lingo, we say that these types are _immutable_. This means that whenever you change the value, Ruby makes a copy and changes that instead.

## Takeaway

Expand All @@ -270,7 +270,7 @@ Primitive types like numbers, booleans and `nil` follow basically the same rules
- Changing what one variable points to does not affect any other variables
- `=`, `+=`, etc.
- Passing an argument to a method creates a new variable referencing the same object
- Primitives (numbers, booleans and `nil`) are _immutable_, meaning the underlying object can't be modified
- Small built-in types like numbers, booleans and `nil` are _immutable_, meaning the underlying object can't be modified

## Additional Resources

Expand Down

0 comments on commit 289c40a

Please sign in to comment.