Mukul Latiyan has Published 322 Answers

Hash select() and select!() methods in Ruby

Mukul Latiyan

Mukul Latiyan

Updated on 25-Jan-2022 10:46:50

In Ruby, we make use of the select() method when we want to find the array from the hash based on the condition and we make use of the select!() method when we want to check whether the array from the hash is present or not.Let's explore a few examples ... Read More

How to use global variables in Ruby?

Mukul Latiyan

Mukul Latiyan

Updated on 25-Jan-2022 10:42:44

Global variables have a global scope and they can be accessed from anywhere in a program. Assignments to global variables can be made from anywhere in the program. Global variables are always prefixed with a dollar sign.It is necessary to define a global variable to have a variable that is ... Read More

How does Recursion work in Ruby Programming?

Mukul Latiyan

Mukul Latiyan

Updated on 25-Jan-2022 10:39:32

A function that calls itself directly or indirectly is called a recursive function, and the corresponding function is referred to as a recursive function. Recursion makes the process easier and it definitely reduces the compilation time.We will try to understand the concept of recursion in Ruby with the help of ... Read More

Yield keyword in Ruby Programming

Mukul Latiyan

Mukul Latiyan

Updated on 25-Jan-2022 10:33:05

There are often cases where we would want to execute a normal expression multiple times inside a method but without having to repeat the same expression again and again. With the yield keyword, we can do the same.We can also pass arguments to the yield keyword and get values in return ... Read More

True, False and Nil in Ruby Programming

Mukul Latiyan

Mukul Latiyan

Updated on 25-Jan-2022 10:29:39

We know that everything in Ruby is treated as an object, and so the true, false and nil as well. They are built-in types that Ruby provides to do different conditional checks and more. In this article, we will explore different examples of the true, false and nil data types ... Read More

Static Members in Ruby Programming

Mukul Latiyan

Mukul Latiyan

Updated on 25-Jan-2022 10:25:26

Static Members in Ruby are declared with the help of the class. Since Ruby doesn't provide a reserved keyword such as static, when we make use of the class variable, then we create a static variable and then we can declare a method of that class in which the static ... Read More

While loop in Lua Programming

Mukul Latiyan

Mukul Latiyan

Updated on 01-Dec-2021 10:58:07

A while loop is an indefinite loop that can be modified to run for a finite number of iterations based on the condition we provide.In Lua, the while condition is tested first. If the condition turns out to be false, then the loop ends, otherwise, Lua executes the body of ... Read More

Variable number of arguments in Lua Programming

Mukul Latiyan

Mukul Latiyan

Updated on 01-Dec-2021 10:50:06

There are functions in Lua that accept a variable number of arguments. These are very helpful in cases where we want to run the same function with many different arguments that might vary in length. So, instead of creating a different function, we pass them in a variable arguments fashion.Syntaxfunction ... Read More

Table Type in Lua Programming

Mukul Latiyan

Mukul Latiyan

Updated on 01-Dec-2021 10:46:45

A table is a data type in Lua, which is used to implement associative arrays. These associative arrays can be used to implement different data structures like queues, maps, lists, etc.An associative array in Lua is an array that can be indexed not only with numbers, but also with strings ... Read More

Return statement in Lua Programming

Mukul Latiyan

Mukul Latiyan

Updated on 01-Dec-2021 10:44:34

There are certain cases where we want to return a value from a given function so that we can use it later. These return values make use of a return keyword which in turn allows a function to return values.There is an implicit return at the end of any function, ... Read More

Previous 1 ... 4 5 6 7 8 9 10 ... 33 Next
Advertisements