Iqra Technology

JS Date & Time Function

❮ Previous Next ❯ Date and Time Function Date and time in JavaScript are primarily handled using the Date object. The Date object provides methods to retrieve and format dates in various formats.The following table describes various JavaScript DateTime formats and their results. Format Result new Date().toLocaleDateString(‘en-US’) 05/29/2015 new Date().toLocaleDateString(‘en-GB’) 29/05/2015 new Date().toLocaleString(‘en-US’, { weekday: […]

JS Date & Time Function Read More »

JS Object Constructors

❮ Previous Next ❯ Object Constructors JavaScript constructors are powerful tools for creating objects with similar properties and methods. Whether you use the traditional constructor function or the newer class syntax, understanding constructors is key to mastering JavaScript. By using constructors, you make your code more organized, reusable, and scalable. So next time you need

JS Object Constructors Read More »

JS Accessors

❮ Previous Next ❯ Accessors (Getters and Setters) In JavaScript, accessors are tools that allow you to retrieve or set the values of object properties. Accessors make working with objects easier and help control how values are read from or written to those objects.An accessor is a special method in JavaScript that either gets a

JS Accessors Read More »

JS Object

❮ Previous Next ❯ Object in JavaScript In JavaScript, an object in JavaScript is like a storage box that holds various kinds of information. You can store different pieces of data inside an object, and each piece of data is stored in a key-value pair. The key is like the label on the box, and

JS Object Read More »

JS Loops

❮ Previous Next ❯ Loops A loop is a programming construct that allows you to execute a block of code repeatedly based on a given condition. Loops help automate repetitive tasks, so you don’t have to write the same code multiple times. Imagine you’re asked to say “Hello” five times. Instead of writing console.log(“Hello”); five

JS Loops Read More »