Welcome to my blog !

Different ways to set multiple CSS styles in javascript with example

January 16, 2022 ·  2 min read

Sometimes, We want to apply HTML CSS styles using javascript code. Html elements do style using an inline CSS selector or CSS selector. Let’s see examples to add inline CSS and class styles to HTML with javascript programming. How to set multiple inline CSS styles in javascript HTML elements can be styled using style attribute. Normally, inline css styels applied using below <div id="mycontent3" style="font-size: 35px; color: red;"> javascript css apply style example </div> Let’s see examples to set multiple inline styles using javascript and jquery....

How to convert decimal to/from a hexadecimal number in javascript

January 11, 2022 ·  2 min read

Hexadecimal number, often known as a Hexa number, is a number with 16 digits. It is based on the Base 16 system, also called a hexadecimal numbering system. Hexadecimal numerals in javascript include decimal numbers, 0-9 (base 10) and an additional six alphabets ranging from A to F. i.e 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F. Example 32F or 1f,2A is a hexadecimal number. Decimal Numbers are numbers with a base of 10, i.e. numbers ranging from 0 to 9....

Different ways to Convert Unix Timestamp into date and time in javascript

January 11, 2022 ·  2 min read

Unix timestamp is a long number, number of milli seconds since 1970-01-01 UTC console.log(Date.now()); //1641894862442 It is a long number also called UNIX timestamp, How do you convert this number to date and time format. Input Unix timestamp is a long number and example is 1641895275360 Output Date format is MM/DD/YYYY and time format is HH:MM: SS. How to convert Unix timestamp to date and time. There are multiple ways we can convert Unix timestamps....

Best ways to remove duplicate elements from array in javascript

January 8, 2022 ·  2 min read

Sometimes, Array contains duplicate data, the developer has to write a code to remove duplicates and return an array with unique elements. There are many ways we can remove duplicates from an array. In this blog post, You will learn 5 ways of duplicate items of the array in javascript/Typescript. using array filter and indexOf method ES6 using set with spread expression Jquery each and inArray method forEach loop implementation UnderscoreJS and lodash with uniq method Given an array of numbers....

You'll get a notification every time a post gets published here.