Posts

Showing posts with the label JavaScript

JavaScript Logical Output Based Interview Questions

Image
You mostly seen in JavaScript interviews there interviewers must asks output based questions in which candidate stuck mostly so here in this blog I'm telling you most commonly asked output based JavaScript interview questions. By Education Funda Most Commonly Asked JavaScript Output Based Questions Question: 1 function sum(){      let a = 8;      const b=2;      var c=a+b; } console.log(a) // Reference error: a is not defined console.log(b) // Reference error: b is not defined console.log(c) // Reference error: c is not defined sum() console.log(a) // Reference error: a is not defined console.log(b) // Reference error: b is not defined console.log(c) //Output: undefined ---------------------------------------------------------------------------- Question: 2 let arr=[1,2,3,4,5]; console.log(arr[2], arr.length); //Output: 3 5 arr.length=0; console.log(arr[2], arr.length); //Output: undefined 0 Note:  As we can see in above code 1st ques...

JavaScript Most Commonly Asked Data Structure Questions

Image
Let's See Some Of The Most Commonly Asked Data Structure Interview Questions with Answers Related To Arrays, String and Objects JS Data Structure - Education Funda 1. Custom sorting program in JS via Bubble Sort ? 2. Write a program to check if a string or word or number is palindrome ? Examples of Palindrome Words are:  racecar, madam. 3. Write a program to check if value/target exists or not in ascending array in O(log n) time complexity ? For doing this you should know the Binary Search Algorithm. 4. Write a program to get total vowel count from String ? 5. Write a program to prints factorial of any number ? 6. Write a program for check number is prime or not from 100 to 200 ? 7. Write a program to check whether number is perfect number or not ? Prime Number:  whose SUM of all factors equal to value expect value itself factor. 8. Write a program to find duplicate numbers in an integer array ? 9. How do you find all pairs of an integer array whose sum is equal to a...

Merge Multiple PDF Buffers in Node JS

Image
Let's See How We Can Merge PDF Buffers in Node JS with "pdf-merger-js" PDF Merger JS - Education Funda For merging pdf buffers we should firstly have the buffers of each pdf and we can run loop than can add each buffer for create one single merge buffer. If You Have HTML Files Which You Want to Convert to PDF Buffer and Create 1 Single Merge PDF const getNoticesPreview = async (req, templateId ) => { const caseIdsArr = req. body . caseIds . split ( "," ); var merger = new mergePdfs (); for ( let i = 0 ; i < caseIdsArr. length ; i ++ ) { let caseId = caseIdsArr[i]; let caseDetails = await caseService. getCase (caseId); let templateDetails = await templateService. getTemplate ( templateId ); let options = { format : 'A4' }; let compiled = ejs. compile (fs. readFileSync ( __dirname + 'public' + templateDetails. templateFile , 'utf8' )...

Loading GIF Loader In Center of Webpage

Image
While page is loading sometimes it takes too much time for that time duration we can show GIF loader or any kind of loader to the users so users can know easily something is happens. Add Loader To Your Webpage   Such as your webpage html code is like below: <body>     <div class="content">         Long Content Here         <br/>         Click to view loading image.     </div>     <div id="divLoading" style="display:none">     </div> </body> We added one div here with the ID divLoading, you can take any ID selector as per your need. Now in webpage you need to add css code so that loader can be show in center of page at any screen size: <style type="text/css">      #divLoading.show      {          display : block; ...

Standard Way To Create Node JS Fresh Project

Image
As you know in programming world JavaScript is becoming quite famous programming language so in this blog we will discuss how we can create fresh project of NodeJS in standard way. NodeJS - Education Funda Requirements Any server should be installed either Apache or Nginx. NodeJS and NPM should be installed in the operating system.  Steps to Install Fresh Node JS Project: First open your terminal and go to your project directory then run following commands ~ npm init (after hitting this command it will ask some basic questions you can answer it as per your need.   ~ npm init ~ npm install express (it will install express server for your project) ~ npm install mongodb (optional - if you want to use mongo) ~ npm install mongoose (optional - if you want to use mongo) ~ npm install nodemon --save-dev (nodemon package is using for automatically refresh after any change and we're using save dev here because we want to install it for development purpose only) To do setup of licens...

Database Seeding in NodeJS with MongoDB

Image
Seeders in NodeJS Database seeding is a process in which we can put predefined data or dummy data in database as per need. such as the data of countries, cities, etc. is fixed data for everyone for these kind of data we can create database seeding files and we can put all the data into database with the help of 1 command only. Step 1 : We should have model firstly for which we want to create seeding so here is an example model Product. productModel.js Step 2 : As we want to run 'database seeders' separately in one command so have can create one file for seeders and in this file we also need to add database connection so that we can communicate with database because here app.js/index.js database connection doesn't work as we want to run this separately so example seeder.js file is: Seeders.js   Step 3 : Now we can run command node seeders.js to create seeding in database Thanks for reading this article I hope it will help you for creating seeders in node js with mongo datab...

Top 15 JavaScript Interview Questions

Image
Most Commonly Asked JavaScript Interview Questions JavaScript is the most popular scripting language and it was developed by Netscape and used to develop the client-side web applications. JS - Education Funda The real name of JavaScript was Mocha . JavaScript is provided by Netscape and JScript name is provided by Microsoft. Check The 15 JavaScript Interview Questions in Below Video: © Education Funda Some Important Features of JavaScript Are: Lightweight Easy to use with html Compatible with most of the programming languages Open source platform for everyone Thanks for reading this article ✌

Node Js Interview Questions

Image
Node.js  is an open source, cross-platform runtime environment for developing server-side and networking applications.  It uses single threaded event loop architecture to handle multiple concurrent clients at same time. The processing model is based on the JS event and callback mechanism. We can do asynchronous tasks easily with this programming language. What is NPM in Node.js ? NPM (Node Package Manager) helps to install all the dependencies of the project from the package.json file.it holds all the metadata about a particular project. We can add or update any package/library very easily with the help of commands only. Let's check the "most commonly asked node js interview questions" in below video: Thanks for reading this blog, I hope this node js interview questions blog will help you to crack node js interview easily.

Top 10 React JS Interview Questions

Image
ReactJS is an open-source, component-based front end library responsible only for the view layer of the application. It was developed by Facebook in 2013. React JS - Education Funda Some Important Notes Virtual DOM The DOM represents a document with a logical tree. Each branch of the tree ends in a node, and each node contains objects. DOM methods allow programmatic access to the tree. Imagine that you have an application and whenever there’s a state change, you want to update only the parts of your DOM tree that depend on those changes. You don’t want to re-render your whole UI from scratch because it would cost a lot, performance-wise, and the UX would be bad. React works with a feature called virtual DOM, a virtual representation of the real DOM tree. It’s just a tree data structure of plain JavaScript objects that is kept synced in memory. Rendering the virtual DOM is faster because it will never be rendered to the user, it will only live in memory. Class Component vs Functional C...

Importance of JavaScript Programming Language

Image
Let's Understand JavaScript If we talk about JavaScript in 2022, it is the most popular programming language as more then 90 % of websites in the internet uses JavaScript. Actually JavaScript was originally designed as a client side scripting language and a large amount of websites still using JavaScript as an client side programming language. © Education Funda Some History of JavaScript JavaScript is the most popular scripting language and it was developed by Netscape and used to develop the client-side web applications. The real name of JavaScript was Mocha . Firstly JS was created by Netscape in 1996 Then It gave it to ECMA company. ECMAScript 1 launched in 1997 and ECMAScript 6 in 2015 known as ES6 based upon OOPS with new methods. JavaScript is provided by Netscape and JScript name is provided by Microsoft. Let's see the Important of JavaScript in below video:  I hope this article will helpful for you regarding the understanding of Importance of JavaScript. Thanks for ...

Full Stack Development

Image
FULL STACK DEVELOPMENT  A Full Stack Web Developer is someone who is able to work on the front-end and the back-end portions on an application. Being a Full Stack Developer doesn't mean that you have necessarily mastered everything required to work with the front-end, But it means that you are able to work on both sides and understands what is going on when building an applications. More About Full Stack Development Guys, for become a full stack developer you should have knowledge of following languages: html & css java-script all back-end languages database and web storage HTTP and rest API   Venn Diagram As in this "Venn Diagram" you can see that "Full Stack Development" is actually a combination of Front-End, Back-End & Database. So, if you have knowledge of all languages than you can become a "Full Stack Developer", I know while reading this 'article' you think this is 'impossible' but don'...

Mean Stack Development

Image
MEAN STACK DEVELOPMENT  M E A N Stands For: Mongo DB Express JS Angular JS Node JS MEAN is a collection of JavaScript-based technologies such as: Mongo DB, Express.js, AngularJS, and Node.js — used to develop web applications. From the client and server sides to databases. MEAN is a Full-Stack development toolkit. More About Mean Stack Development Work Process Diagram As in the above diagram clearly shown how these technologies works together for develop an Web Application. Angular JS being client makes AJAX calls to Express JS then it response in JSON format. Express JS that is running on Node JS server further communicate with Mongo DB(No SQL Database) as persistent medium.  I hope below video will also help you for more Thank You For Reading This Article