question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Basic JavaScript: Passing Values to Functions with Arguments

See original GitHub issue

Describe your problem and how to reproduce it:

The challenge instructions say:

  1. Call the function with two numbers as arguments.

But you can only pass positive integers. I suggest that either the instruction is changed to:

  1. Call the function with two positive integers as arguments.

or the regex should be changed to:

^\s*functionWithArgs\s*\(\s*[-+]?[0-9]*\.?[0-9]*.\s*,\s*[-+]?[0-9]*\.?[0-9]*.\s*\)\s*`

so that it can accept negatives and decimals.

Changing the regex would probably be simpler because it could be changed across all the language files without having to worry about translation. Plus it would probably be easier for the average reader to understand - not changing the instructions.

I can handle this once there is agreement.

Add a Link to the page with the problem:

here

Tell us about your browser and operating system:

  • Browser Name: Chrome
  • Browser Version: Version 85.0.4183.121 (Official Build) (64-bit)
  • Operating System: Macbook Catalina

If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):

Screen Shot 2020-09-24 at 9 34 38 PM Screen Shot 2020-09-24 at 9 35 25 PM

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
RandellDawsoncommented, Sep 26, 2020

@ItsOKayCZ Sure, I believe you can try to use the assert I referenced above. Make sure to read through our Contributor docs, so that you end up creating a valid PR. Make sure to create your changes on a branch off your fork’s master, to keep it from getting soiled.

1reaction
RandellDawsoncommented, Sep 26, 2020

And do it for all the languages - I assume they’d all want these changes.

Actually, this is not necessary. The non-English versions of the curriculum will use the testString of the English file. We will be making some change to the overall repo that will remove everything except the description, instructions, and test text of the non-English files. Since, those are the only parts needing translation as we will use the English file for the other sections.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Passing Values to Functions with Arguments - GitHub
Passing Values to Functions with Arguments ... Parameters are variables that act as placeholders for the values that are to be input to...
Read more >
Passing-values-to-functions-with-arguments - JavaScript
When you are defining a function, you can specify variables for that functions scope. The variables will only be available within that function...
Read more >
JavaScript Function Parameters - W3Schools
Arguments are Passed by Value. The parameters, in a function call, are the function's arguments. JavaScript arguments are passed by value: The function...
Read more >
Understanding JavaScript Pass By Value
In JavaScript, all function arguments are always passed by value. It means that JavaScript copies the values of the variables into the function...
Read more >
Pass by Value and Pass by Reference in Javascript
Pass by Reference: In Pass by Reference, Function is called by directly passing the reference/address of the variable as an argument. So ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found