Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using .times method in Ruby gets wrong output #207

Open
lulunac27a opened this issue Dec 17, 2023 · 0 comments
Open

Using .times method in Ruby gets wrong output #207

lulunac27a opened this issue Dec 17, 2023 · 0 comments

Comments

@lulunac27a
Copy link

lulunac27a commented Dec 17, 2023

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 "))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant