More operators: +=, -=, *=, /=
For: when you don't know how many times you need to loop
For the () puts ()
ex: for num in 1...10 puts num end
(...)= exclude the last digit
(..)= include the last digit
Loop: create basic but infinite loop.
Next: Can be used to skip over certain steps in the loop.
Array: my-array can store numbers in a variable
my_array = [1,2,3,etc]
.each: can apply an expression to each element of an object. You wrap in (| |)
.times: It performs a task on an item a specified number of times.
ex: 10.times { print "Chunky bacon!" }
until: Until a certain criteria is met
Using Loop iterator to print out the Ruby string 30 times:
Top comments (0)