in Education by
I am trying to add an if condition; Idea is If I enter the input as print or text with 4 in it, else block should be called. if ((turnContext.activity.text.indexOf('print') == -1) || (turnContext.activity.text.indexOf('4') == -1)) Now, it goes into the if block as opposed to else. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You have to use: &&. Otherwise when the text is print, the text is not 4 entering the if block. if ((turnContext.activity.text.indexOf('print') == -1) && (turnContext.activity.text.indexOf('4') == -1)) { // not 4 nor print } else { // print or 4 }

Related questions

0 votes
    I am trying to add an if condition; Idea is If I enter the input as print or text with 4 in ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I am trying to add an if condition; Idea is If I enter the input as print or text with 4 in ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I have working (stock) script from node var cluster = require('cluster'); var http = require(' ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I am trying to write some stuff in a file using reactJS and nodeJs but it doesnt work. Here is ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I am trying to write some stuff in a file using reactJS and nodeJs but it doesnt work. Here is ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    app.route('/users') .post(user.post) .get(user.get) .get(user.everyone) .put(user.update) . ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 3, 2022 in Education by JackTerrance
0 votes
    I'm used to v3 node botbuilder sdk so I have a middleware where I look at the dialog stack and ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    The napi_create_date function appeared in Node.js starting with 11.11.0 version. https://nodejs.org/api/n- ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    I'm trying to debug my nodejs app using node-inspector. But Google Chrome doesn't show the code. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 11, 2022 in Education by JackTerrance
0 votes
    My websocket application accepting connections like this: wsServer.on('request', function(request) { console.log( ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 8, 2022 in Education by JackTerrance
0 votes
    Quick Summary of my question: Does Gulp 3.6.0 dest() handle glob-base the same way as 4.0.0? ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 19, 2022 in Education by JackTerrance
0 votes
    There are a lot of samples on running Async/Await functions. But only with one await call. I don' ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 11, 2022 in Education by JackTerrance
0 votes
    I'm trying to include actual date and time to the certain message, however I'm unable to do it, ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I'm trying to make a form-maker with Node.Js and MongoDB but confused about the data structure. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    I'm trying to use babel to run my NodeJS program, which includes ES6 syntax and exports from the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 13, 2022 in Education by JackTerrance
...