A Node.js developer wants to connect Redis to the localhost on port 6379.What is the correct option to achieve this requirement?

const REDIS_PORT = process.env.REDIS_PORT || 6379; 

const client = redis.connect(REDIS_PORT);

const REDIS_PORT = process.env.REDIS_PORT || 6379; 

const client = redis.createClient(REDIS_PORT);

const REDIS_PORT = process.env.REDIS_PORT || 6379; 

const client = redis.bind(REDIS_PORT);

const REDIS_PORT = process.env.REDIS_PORT || 6379; 

onst client = redis.createConnection(REDIS_PORT);

Verified Answer
Correct Option - b

To get all Infosys Certified NodeJS Architect Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee

Telegram