This file contains hidden or 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
| Strings and numbers are known as primitive data types. Primitive data types are basically the smallest building blocks for Ruby programs. In the next exercise, you'll work with more building blocks. | |
| Booleans are a primitive data type, just like Strings and Numbers. Booleans can have one of two values: true or false. | |
| There's one more primitive data type to explore before moving on: the Symbol. Symbols are like strings, only with less functionality. A Symbol is designated with a colon (:) to the left of a word. Symbols can contain any alpha-numeric character, but they must start with a letter. | |
| While "hello" + 3 doesn't make sense, you can mix strings and numbers if the return is meant to be a string. Combining strings and numbers is called string interpolation. String interpolation is the act of inserting a non-string value into a String, thus creating a new String. Interpolation is accomplished with the #{ } syntax. | |
| The modulo operator – % – returns the integer remainder of a quotient. For example, when d |
NewerOlder