Skip to content

Using .times method in Ruby gets wrong output #207

@lulunac27a

Description

@lulunac27a

When I use the .times method in Ruby, I get the wrong JavaScript output:

3.times do
  puts 'Welcome '
end

should be

for (let i = 1; i <= 3; i++) {
  console.log("Welcome ")

or

for (let i = 0; i < 3; i++) {
  console.log("Welcome ")

not

(3).times(() => console.log("Welcome "))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions