0

javascript pratice test cannot understand or may be i dont understand how yo use this geature

i cannot understand pratice tests in javascript. when i solve if/else contruct practice test i doesnot understand "function main" and "parseInt" and "readLine" function. why they are already written there when start coding. Moreover, I also dont understand test cases. plz give me in details explanation. Also when i use sample input in " if" condition it ask to enter another. input. It sounds scary or may be i dont understand how to use these practice scenarios. Plz explain me in detail

27th Jul 2021, 3:06 PM
Farooq Shah
Farooq Shah - avatar
2 Réponses
+ 1
readLine is for accepting inputs (that sololearn will use to test for different inputs). Function main will be called by sololearn , so you don't even need to worry about that . Usually the function main() is the entry point for many languages to run the code from. parseInt is used to convert a value to integer. And the execution environment is nodejs (server side language)
27th Jul 2021, 3:43 PM
Abhay
Abhay - avatar
0
Abhay when i put sample input "test case 1"solved but two other test cases result wrong. and when i put input take from from result of test case 2 which it say input for case 2 then case 1 and case 3 wrong. I canot understand myth to solve exercises. Please help
30th Jul 2021, 3:26 AM
Farooq Shah
Farooq Shah - avatar