Kembali ke Perpustakaan
Region:
Switch to EN
Pemula Exercism • ruby
Nil
Ringkasan Pelajaran
# Introduction
About
Nil is an English word meaning “nothing” or “zero”. In Ruby, nil is an object which is used to express the absence of a value. In other programming languages, null or none values may play a similar role.
# I do not have a favorite color
favorite_color = nil
Ruby gives any instance variable the default value of nil when it is first encountered, until it is set otherwise.
Originally from Exercism ruby concepts