Answer to Question #270203 in HTML/JavaScript Web Application for prime

Question #270203

Here in this program "aqString" was not defined please check it again

let inputString = '';

let currentLine = 0;

process.stdin.on('data', inputStdin => {

inputString += inputStdin;

});

process.stdin.on('end', _ => {

inputString = inputString.trim().split('\n').map(string => {

return string.trim();

});

main();

});

function readLine() {

return inputString[currentLine++];

}

function main() {

const inputString = readLine();

const subString = readLine();

let index = aqString.find(inputString, subString);

if (isNaN(index) && index <= inputString.length) {

console.log(inputString.split(index));

}

}


1
Expert's answer
2021-11-26T07:09:24-0500
<script>
    let inputString = '';


    let currentLine = 0;


    process.stdin.on('data', inputStdin => {


      inputString += inputStdin;


    });


    process.stdin.on('end', _ => {


      inputString = inputString.trim().split('\n').map(string => {


        return string.trim();


      });


      main();


    });


    function readLine() {


      return inputString[currentLine++];


    }


    function main() {
      let aqString = readLine();


      const inputString = readLine();


      const subString = readLine();


      let index = aqString.find(inputString, subString);


      if (isNaN(index) && index <= inputString.length) {


        console.log(inputString.split(index));


      }


    }
  </script>

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS