Posts

Showing posts from March, 2023

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: a is not defined console.log(c) // Reference error: a 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 questions is so easy but second is bit tricky one

Run Node JS Project Without Port in URL

Image
We can remove PORT from URL in Node JS project from server configuration files So we have mainly two types of server base: Nginx Apache For both we generally have /etc/nginx/default OR /etc/apache2/default file . So you have to edit it manually which you can do via below steps: 1. Firstly go into nginx/apache2 directory  Then, Run command: ~ sudo nano default configuration file will open in edited mode from which you can edit now server { listen 80 default_server; listen [::]:80 default_server; location { proxy_pass http://yourdomain.com:3000;      #try_files comment this line manually via adding # } } Restart your server via nginx/apache2 ~ sudo service nginx restart ~ sudo service apache2 restart That's it now check http://yourdomain.com this will also work same. Happy Coding !!

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 given number?