Currently, I am working on a TypeScript project that involves taking user input for the addition of two numbers. Below is the code snippet I am using:
function rotatedString(S1,S2){
return S1+S2;
}
function processData() {
//INPUT[uncomment & modify if required]
var temp = gets().trim('\n').split('\n');
var S1 = temp[0];
var S2 = temp[1];
//OUTPUT[uncomment & modify if required]
console.log(rotatedString(S1,S2));
}
processData();
However, I encountered an error while running this code on https://www.typescriptlang.org/.
The error message reads: Parameter 'S1' implicitly has an 'any' type. Parameter 'S2' implicitly has an 'any' type. Cannot find name 'gets'.
I would greatly appreciate any assistance or advice on how to properly take user input in TypeScript.