Categories

Nodejs File System. Load module with name ‘fs’ To Read a file use fs.readFile  To Write a file use fs.writeFile (Note : if file does not exists it will create the file) existsSync is used to check if file or ...

 In this article I am going to mention 6 Javascript Recursion examples. How Recursion works. It basically works by calling same function again and again until it reaches a base case that is usually an if condition and from here ...

 Here we will simply create a static file using file module and then send the same file as the response. To view the result run this file using node app.js then visit localhost:8080 in the browser const fs = require("fs"); ...

 var – Global scope when var variable is declared outside a function. It means that if you write following code  if(true){     var x = 30 } console.log(x) In console it will print 30 so it means x has a ...

 Suppose we have an array [1,2,3,4,5,6] and array is sorted in ascending order. Now we are asked to find the position of number 5 in the array using binary search. If number is found then return it’s index otherwise return ...

adbanner