+ 1
JavaScript - Some questions about my little code.
Hello everyone, I need some help with the following code, any help will be appreciated. The questions have been asked within the code. Thanks! https://code.sololearn.com/WLIalIN8HRDR/#js
4 odpowiedzi
+ 17
Bahamin Shahriari Hi, adding parameters in function is easy, just create function and add parameter like
function func(paramA, paramB){}
then call func(1, "test");
Lower input = toLowerCase();
Your concatenating style is fine
Semicolons in the end of objects is optional. Just write it.
userChoice == null is bad; use userChoice.length === 0 instead
Commas in objects are delimiters so there is no need to put them in behind last attr or method.
+ 11
Bahamin Shahriari Don't be lazy and write it manually☺
+ 1
r8w9 hello, i have made changes and added questions to the code since you visited, would be great if you could help, thanks
+ 1
r8w9 Thank you for your response.
I got almost all the answers except for the first question. I was using prompt function which only takes two parameters, so I wanted to get the value of rentOperation.car1 in the prompt instead writing it manually, is there any way to get variable's value inside the string?