ZRTECH SOLUTIONS

Node JS Express Image Upload Rest API Example

In this tutorial, we will create very simple way rest API for Image Uploading using node js and multer. we will use express, multer, body-parser npm package for creating image upload with node.js and multer. Now you have to follow few step to create rest api for image upload with node js. we are giving […]

Node JS – How to Delete All Files in Directory?

This simple article demonstrates of how to delete all files in folder node js. This post will give you simple example of node.js delete all files in directory. i explained simply about node delete all files in directory. you can understand a concept of node js delete all files in folder. Let’s see bellow example […]

Node JS CRUD with MySQL Tutorial Example

Today, node js crud example with mysql is our main topic. i explained simply step by step node.js express mysql crud example. you’ll learn crud operation in node js using express mysql. this example will help you node js crud api with mysql. you will do the following things for node js crud api tutorial. […]

Q. Explain what a callback function is and provide a simple example

A callback the function is a function that is passed to another function as an argument and is executed after some operation has been completed. Below is an example of a simple callback function that logs to the console after some operations have been completed.

Q. Explain arrays in JavaScript

An array is an object that holds values (of any type) not particularly in named properties/keys, but rather in numerically indexed positions:

Q. Explain is Scope in JavaScript?

In JavaScript, each function gets its own scope. The scope is basically a collection of variables as well as the rules for how those variables are accessed by name. Only code inside that function can access that function’s scoped variables. A variable name has to be unique within the same scope. A scope can be nested […]

Q. What is the object type?

The object type refers to a compound value where you can set properties (named locations) that each hold their own values of any type. Bracket notation is also useful if you want to access a property/key but the name is stored in another variable, such as:

How do you clone an object? Javascript object clone

Javascript object clone Now the value of objclone is {a: 1 ,b: 2} but points to a different object than obj. Note the potential pitfall, though: Object.assign() will just do a shallow copy, not a deep copy. This means that nested objects aren’t copied. They still refer to the same nested objects as the original: