DEV Community

Lateef Idris
Lateef Idris

Posted on

Ruby Intro

ruby is a programming language that allows us to make our web apps interactive

what I've learned so far about ruby's syntax is:
variable = "value"

variable can be a:
-"string"- any text
-boolean: true or false
-Integer: 0
-Float: 3.568
-array[]
-symbol:
-{#hash}

there are different types of loops, like .each and .loop
if, else, elsif, unless, and i think while statements
always end with end

the index for an array starts with 0 being the first number
[ 1, 2, 3, 4 ]

so array[0] would = 1

there are different methods to manipulate or get data
such as:
.times
gets.chomp
.upcase
.downcase
.length
.split
.each
.loop
.to_i
.to_s

Top comments (0)