In JavaScript ES6, for-in loop and for-of loop, the variable i stops to exist after each iteration of the block? [duplicate]

This question already has an answer here: ECMAScript 2015: const in for loops 3 answers Typically I’d use a let i in the following first two cases: > for (const i in [“red”, “green”, “blue”]) { console.log(i) } 0 1 2 > for (const i of [“red”, “green”, “blue”]) { console.log(i) } red green blue…

Details

agent.add() sometimes not able to give results in dialogflow

I am using Dialogflow to build a chatbot and I am using Axios to make some posts and get requests, but sometimes agent.add() inside that HTTP call doesn’t work. I am attaching the sample code. const functions = require(‘firebase-functions’); const {WebhookClient} = require(‘dialogflow-fulfillment’); const {Card, Suggestion} = require(‘dialogflow-fulfillment’); // Using some external libraries //axios for…

Details