For every click, an event will be triggered and that event contains all the info about the element. So, we obviously have to catch that event to get the element info and it can be easily done with JS. When…
Programming
As per my experience, the screen rotation behaviour across different devices is not the same. The events such as resize and orientation may not fire simultaneously and occur at different timeframes. The values such as window.orientation and screen.width may not…
To set the document title in reactJS, we can create a custom hook and use it. The following is the solution. Now, use the above custom hook in whichever component you want. The above custom hook updates the title with…
It is straightforward to replace the DOM element in javascript with some other element. replaceWith() method is used to replace the HTML element in Javascript. Follow is the working example: This is a span element Code: Explanation In the above…
Unlike java where the object for the class can be declared only in the heap, C++ allows us to allocate memory for an object in the stack Object in stack If an object is required for a shorter amount of…
In this article, I will give an introduction to the object oriented programming and we will see what is the major difference between module based programming approach and object oriented programming. Unlike C programming language which follows a procedural/modular based…
What is endianness? Endianness specifies the order in which the bytes of data are stored/processed by a computer. For example, let’s consider a variable that is of 4bytes, and in the memory, it looks like this as shown below. When…
Object files contain the binary information which is generated by either assembler or linker. In Linux object files are in Executable and linkable file format (.elf). In general, we have three types of object files in Linux(i.e. .c file). They…
What are a bit, Nibble and Byte? Computer memory is an electronic chip that consists of millions of transistors and capacitors. A transistor and a capacitor are paired to create a memory cell that stores one bit of data. Such…
We can easily convert a string to a date object using the function Date(). It accepts the string in different formats. For example: We can pass the year, month, and day separately such that it automatically creates the date object…