Author name: Sarthaki Joshi

Use strict in JavaScript

In JavaScript, `\“use strict\“` is a command that turns on strict mode, an option to use a more limited version of JavaScript. It was added to ECMAScript 5 and is intended to make JavaScript perform better and to check for errors more thoroughly by requiring stricter parsing and error checking. When you implement strict mode, some actions normally permitted in non-strict mode will cause exceptions. This will allow developers to identify frequent mistakes and block potentially problematic features from being used. Some of the most important elements of strict mode are: Features of strict mode: 1. Prevents the use of undeclared variables: In non-strict mode, assigning a value to an undeclared variable creates …

Use strict in JavaScript Read More »

Uploading image and store in Node.js

To upload and save an image within a Node.js application, you may use the multer middleware for multipart/form-data handling, which is essentially utilized for uploading files. Here’s a step-by-step guide: Step 1: Prepare Your Node.jsProject Initialize a new Node.js project: mkdir image-upload cd image-upload npm init -y Install the required dependencies: npm install express multer mkdir image-upload: This command makes a new directory (folder) called image-upload. The …

Uploading image and store in Node.js Read More »

Move an HTML element using JavaScript

Certainly! You can move an HTML element using JavaScript by modifying its `style` properties, such as `left`, `top`, `transform`, or using CSS transitions and animations. Here’s a basic example demonstrating how to move an element using JavaScript and inline styles: Moving an HTML element using JavaScript involves several steps. Here, I’ll explain the process in …

Move an HTML element using JavaScript Read More »

Scroll to Top