Skip to content

Instantly share code, notes, and snippets.

View rahulbanerjee26's full-sized avatar

Rahul Banerjee rahulbanerjee26

View GitHub Profile
let names = ['Rahul','Rohit','Rohan']
function addNewName(name){
setTimeout(function(){
names.push(name)
},5000)
}
function printNames(){
setTimeout(function(){
console.log(names)
},3000)
function sayHello(){
let name = 'Rahul'
function inner(){
console.log(`Hello ${name}`)
}
return inner
}
let abc = sayHello()
console.log(abc)
function sum(x){
return function(y){
return function(z){
return x + y + z
}
}
}
console.log(sum(10)(20)(30))
// Output: 60
function sum(x, y, z){
return x + y + z
}
console.log(sum(10, 20, 30))
// Output: 60
const outerFunc = () => {
console.log("Outer Function")
const innerFunc = () =>{
console.log("Inner Function")
}
return innerFunc
}
outerFunc()()
// OUTPUT
const myFunc = (greetings,name) => `${greetings()}, ${name}! `;
const hello = () => "Hello"
const bonjour = () => "Bonjour"
const salut = () => "Salut"
const result_1 = myFunc(hello,"Rahul");
const result_2 = myFunc(bonjour,"Rahul");
const result_3 = myFunc(salut,"Rahul");
console.log(result_1);
const myFunc = name => `Hello, ${name}! `;
const result = myFunc("Rahul");
console.log(result);
// Output: Hello, Rahul!
"redirect": {
"uri": "https://TwilioAIPhoneServiceAI.rahulbanerjee26.repl.co/user",
"method": "POST",
}
"redirect": {
"uri": f'{api_url}/user',
"method": "POST"
}
else:
postData = json.loads(request.form['Memory'])
postData = postData['twilio']['collected_data']['user_information']['answers']
name = postData['user_name']['answer']
phoneNumber = postData['user_phone_number']['answer']
db[name] = phoneNumber
return {
"actions": [{
"say": f"Thank You, {name}! Your info has been saved in the repl db"
}]