{"pageProps":{"posts":[{"slug":"cypress-check-if-element-is-clickable","title":"How to check if an element is clickable in Cypress","author":{"name":"Suraj Sharma","picture":""},"date":"2023-03-05T01:00:00.000Z","url":"cypress-check-if-element-is-clickable","hashtags":"#javascript #cypress","excerpt":"Learn how you can check if an element is clickable in Cypress"},{"slug":"cypress-get-text-of-an-element","title":"How to get text of an element in Cypress","author":{"name":"Suraj Sharma","picture":""},"date":"2023-03-05T00:00:00.000Z","url":"cypress-get-text-of-an-element","hashtags":"#javascript #cypress","excerpt":"Learn how you can get the text content of an html element in Cypress"},{"slug":"axios-delete-request","title":"How to send a delete request in axios","author":{"name":"Suraj Sharma","picture":""},"date":"2022-12-16T00:00:00.000Z","url":"axios-delete-request","hashtags":"#javascript #axios","excerpt":"Learn how to send a delete request in javaScript using axios"},{"slug":"convert-positive-to-negative-in-javascript","title":"How to convert a positive number to negative in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2022-12-15T00:00:00.000Z","url":"convert-positive-to-negative-javascript","hashtags":"#javascript","excerpt":"Learn to convert a postive number to a negative number in JavaScript"},{"slug":"javascript-get-yesterday-date","title":"How to get yesterday date in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-24T00:00:00.000Z","url":"javascript-get-yesterday-date","hashtags":"#javascript #date","excerpt":"Get yesterday date in vanilla JavaScript using Date object"},{"slug":"javascript-get-tomorrow-date","title":"How to get tomorrow date in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-23T00:00:00.000Z","url":"javascript-get-tomorrow-date","hashtags":"#javascript #date","excerpt":"Get tomorrow date in vanilla JavaScript using Date object"},{"slug":"javascript-get-current-date","title":"How to get current date in Javascript","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-21T00:00:00.000Z","url":"javascript-get-current-date","hashtags":"#javascript #date","excerpt":"Get current date in Javascript using the Date.toLocaleDateString method"},{"slug":"store-objects-with-localstorage","title":"How to store objects in HTML5 localStorage","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-10T00:00:00.000Z","url":"store-objects-with-localstorage","hashtags":"#javascript #html5","excerpt":"Use the JSON.stringify method to store objects in HTML5 localStorage"},{"slug":"javascript-iterate-through-string","title":"How to iterate through a string in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-05T00:00:00.000Z","url":"javascript-iterate-through-string","hashtags":"#javascript #string","excerpt":"Learn two ways to iterate through a string in JavaScript"},{"slug":"javascript-get-current-year","title":"How to get current year in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2022-07-06T00:00:00.000Z","url":"javascript-get-current-year","hashtags":"#javascript #date","excerpt":"Get current year in JavaScript using the Date object"},{"slug":"javascript-remove-all-occurences-of-an-element-from-an-array","title":"How to remove all occurences of an element from an array in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2022-06-18T00:00:00.000Z","url":"javascript-remove-all-occurences-of-an-element-from-an-array","hashtags":"#javascript","excerpt":"Learn to remove all occurences of an element from an array in JavaScript in O(1) space complexity"},{"slug":"javascript-check-if-value-is-number","title":"How to check if a value is a number in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2022-03-28T00:00:00.000Z","url":"javascript-check-if-value-is-number","hashtags":"#javascript","excerpt":"Learn two ways to check if a value is of number type in JavaScript"},{"slug":"javascript-get-index-of-an-item-in-array","title":"How to get index of an item in an array in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2021-10-31T00:00:00.000Z","url":"javascript-get-index-of-an-item-in-array","hashtags":"#javascript #array","excerpt":"Learn to find index of an item in a given array in JavaScript using arrays built-in methods"},{"slug":"javascript-spilt-string-into-words","title":"How to split a string into words in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2021-09-15T00:00:00.000Z","url":"javascript-split-string-into-words","hashtags":"#javascript #string","excerpt":"Learn to split a sentence into words in JavaScript using the string.split() method"},{"slug":"javascript-random-strings","title":"How to randomly generate alphanumeric strings in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-30T00:00:00.000Z","url":"javascript-random-string","hashtags":"#javascript","excerpt":"Learn about generating random alphanumeric strings in JavaScript"},{"slug":"javascript-float-to-integer","title":"How to convert a float to an integer in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-16T00:00:00.000Z","url":"javascript-float-to-integer","hashtags":"#javascript","excerpt":"Learn to use various JavaScript Math methods to convert a float number to an integer number"},{"slug":"javascript-array-sort-alphanumeric","title":"How to sort an array of alphanumeric strings in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-13T00:00:00.000Z","url":"javascript-array-sort-alphanumeric","hashtags":"#javascript #array","excerpt":"Learn to sort an array of alphanumeric values in JavaScript using the String.localeCompare() method"},{"slug":"javascript-get-first-n-elements-of-array","title":"How to get first N elements of an array in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-07T00:00:00.000Z","url":"javascript-get-first-n-elements-of-array","hashtags":"#javascript #array","excerpt":"Get first N number of elements of an array in JavaScript in two simple ways"},{"slug":"javascript-loop-through-object","title":"How to loop through an object in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-05T00:00:00.000Z","url":"javascript-loop-through-object","hashtags":"#javascript","excerpt":"Learn two ways to iterate through an object in JavaScript"},{"slug":"javascript-remove-empty-objects-from-array","title":"How to remove empty objects from an array in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-04T00:00:00.000Z","url":"javascript-remove-empty-objects-from-array","hashtags":"#javascript","excerpt":"Learn to remove empty objects and empty arrays from an array in JavaScript"},{"slug":"javascript-check-for-empty-object","title":"How to check for an empty object in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-03T00:00:00.000Z","url":"javascript-check-for-empty-object","hashtags":"#javascript","excerpt":"Learn Two ways to check if a JavaScript object is empty"},{"slug":"javascript-multiple-conditions-switch-case","title":"How to write multiple conditions with a switch case in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-02T00:00:00.000Z","url":"javascript-multiple-conditions-switch-case","hashtags":"#javascript","excerpt":"Write multiple OR conditions with a single switch case statement in JavaScript"},{"slug":"javascript-array-remove-empty-elements","title":"How to remove empty elements of an array in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-01T00:00:00.000Z","url":"javascript-array-remove-empty-elements","hashtags":"#javascript #array","excerpt":"Learn to remove empty and falsy elements of an array in JavaScript using Array.filter method"},{"slug":"javascript-find-index-in-array-of-objects","title":"How to find index in an array of objects in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2021-05-29T00:00:00.000Z","url":"javascript-find-index-in-array-of-objects","hashtags":"#javascript #array","excerpt":"Learn how you can find index of an item in an array of object in JavaScript using Array.findIndex() method"},{"slug":"javascript-function-return-multiple-values","title":"How to return multiple values from a JavaScript function","author":{"name":"Suraj Sharma","picture":""},"date":"2021-05-27T00:00:00.000Z","url":"javascript-function-return-multiple-values","hashtags":"#javascript","excerpt":"In this tutorial, you’ll learn how you can return multiple values from a JavaScript function using Array destructuring and object destructuring."},{"slug":"javascript-key-exists-in-object","title":"How to check if a key exists in a JavaScript object","author":{"name":"Suraj Sharma","picture":""},"date":"2021-05-26T00:00:00.000Z","url":"javascript-key-exists-in-object","hashtags":"#javascript","excerpt":"Learn 2 way to check if a key exists in given JavaScript object"},{"slug":"axios-set-headers","title":"How to set HTTP headers in Axios","author":{"name":"Suraj Sharma","picture":""},"date":"2021-05-25T00:00:00.000Z","url":"axios-set-headers","hashtags":"#javascript #axios","excerpt":"Learn 2 different ways to set HTTP headers in Axios"},{"slug":"javascript-ascii-code","title":"How to convert ASCII code to a character in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-12-07T12:10:00.000Z","url":"javascript-ascii-code","hashtags":"#javascript","excerpt":"Convert ASCII code to sting and character and vice versa in JavaScript"},{"slug":"javascript-array-get-last-element","title":"How to get the last element of an Array in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-26T12:00:00.000Z","url":"javascript-array-get-last-element","hashtags":"#javascript #array","excerpt":"In this tutorial, I have discussed 2 ways to get the last element of an Array in JavaScript"},{"slug":"javascript-detect-dark-mode","title":"How to detect if dark mode is enabled on a browser using JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-20T02:00:00.000Z","url":"javascript-detect-dark-mode","hashtags":"#javascript","excerpt":"In this tutorial, you will learn how you can check if dark mode is enabled on your browser using the window.matchMedia() method"},{"slug":"is-javascript-array-empty","title":"How to check if an array is empty in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-18T12:00:00.000Z","url":"is-javascript-array-empty","hashtags":"#javascript #array","excerpt":"Learn the easiest way to find whether the given array is empty or not"},{"slug":"javascript-array-remove-first-element","title":"How to remove the first element of an array in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-17T12:00:00.000Z","url":"javascript-array-remove-first-element","hashtags":"#javascript #array","excerpt":"Learn to use Array.shift() method and array destructuring to remove the first element of an array in JavaScript"},{"slug":"is-javascript-object-an-array","title":"How to check if an object is an array in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-16T12:00:00.000Z","url":"is-javascript-object-an-array","hashtags":"#javascript #array","excerpt":"Learn how you can use Array.isArray method to check if an object is an array in JavaScript"},{"slug":"javascript-array-unshift-method","title":"How to add an element at the beginning of an array in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-15T12:10:00.000Z","url":"javascript-array-unshift-method","hashtags":"#javascript #array","excerpt":"In this tutorial, you will learn how you can add a new element at the beginning of an array in JavaScript using unshift() method and array destructuring"},{"slug":"javascript-remove-substring","title":"How to remove a particular substring from a string in javascript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-14T06:00:00.000Z","url":"javascript-remove-substring","hashtags":"#javascript #string","excerpt":"Learn to use the replace() and the split() method to remove a substring from a string in JavaScript"},{"slug":"boolean-to-string-javascript","title":"How to convert a boolean to a string in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-30T23:00:00.000Z","url":"boolean-to-string-javascript","hashtags":"#javascript","excerpt":"Learn to convert a boolean to a string in JavaScript"},{"slug":"convert-string-to-boolean-javascript","title":"How to convert a string to a boolean in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-27T14:00:00.000Z","url":"convert-string-to-boolean-javascript","hashtags":"#javascript #string","excerpt":"Learn to convert a string to a boolean in JavaScript"},{"slug":"remove-last-character-javascript-string","title":"How to remove the last character of a string in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-24T17:00:00.000Z","url":"remove-last-character-javascript-string","hashtags":"#javascript","excerpt":"In this tutorial, you will learn to remove the last character of a JavaScript string using the substring() and the slice() methods"},{"slug":"error-handling-in-javascript-async-await","title":"How to handle an error in async await in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-24T15:00:00.000Z","url":"error-handling-in-javascript-async-await","hashtags":"#javascript","excerpt":"In this tutorial, you will learn to handle an error in JavaScript async await"},{"slug":"break-out-of-foreach-javascript","title":"How to break out of the Array forEach method in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-24T01:00:00.000Z","url":"break-out-of-foreach-javascript","hashtags":"#javascript #array","excerpt":"In this tutorial, you will learn to break out of the array.forEach method in JavaScript"},{"slug":"javascript-array-first-element","title":"How to get the first element of an array in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-24T00:00:00.000Z","url":"javascript-array-first-element","hashtags":"#javascript #array","excerpt":"In this tutorial, I have discussed 3 ways to get the first element of a JavaScript array"},{"slug":"check-object-in-javascript-array","title":"How to check if a value exists in an array of objects in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-17T00:00:00.000Z","url":"check-object-in-javascript-array","hashtags":"#javascript #array","excerpt":"2 JavaScript Array methods to check if a value is present in an array of objects; some() and find() methods."},{"slug":"javascript-string-starts-with","title":"How to check if a string starts with substring in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-14T12:00:00.000Z","url":"javascript-string-starts-with","hashtags":"#javascript #string #es6","excerpt":"In this tutorial, I have discussed 4 ways to check if a JavaScript string starts with a substring"},{"slug":"javascript-array-includes-value","title":"How to check if an Array includes a value in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-12T12:00:00.000Z","url":"javascript-array-includes-value","hashtags":"#javascript #array","excerpt":"In this tutorial, I have discussed 5 ways to check if an JavaScript array includes a value"},{"slug":"decimal-to-hexadecimal-javascript","title":"How to convert a Decimal to a Hexadecimal in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-10T00:00:00.000Z","url":"decimal-to-hexadecimal-javascript","hashtags":"#javascript","excerpt":"I have discussed how you can convert a decimal to a hexadecimal and a hexadecimal to a decimal number using toString and parseInt methods respectively."},{"slug":"string-contains-substring-javascript","title":"How to check if a string contains a substring in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-08T00:00:00.000Z","url":"string-contains-substring-javascript","hashtags":"#javascript #string #es6","excerpt":"In this tutorial, I have discussed how to check if a sting contains a substring in JavaScript using includes() and indexOf() methods"},{"slug":"merge-arrays-in-javascript","title":"How to merge two or more arrays in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-07T22:00:00.000Z","url":"merge-arrays-in-javascript","hashtags":"#javascript #array #es6","excerpt":"In this tutorial, I have discussed two ways to merge two or more arrays in JavaScript"},{"slug":"uppercase-first-letter-in-javascript","title":"How to uppercase the First Letter of a String in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-07T00:00:00.000Z","url":"uppercase-first-letter-in-javascript","hashtags":"#javascript #string #es6","excerpt":"Uppercase the first letter of a sting in JavaScript using slice() and toUpperCase() methods"},{"slug":"repeat-string-in-javascript","title":"How to Repeat a String in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-05T14:03:00.000Z","url":"repeat-string-in-javascript","hashtags":"#javascript #string #es6","excerpt":"4 best ways to repeat a string for N number of times in JavaScript, using Array.join(), string.repeat(), for loop, and recursion"},{"slug":"array-to-string-in-javascript","title":"How to convert an Array to a String in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-03T14:00:00.000Z","url":"array-to-string-in-javascript","hashtags":"#javascript #string #array","excerpt":"4 different ways to convert an array to a string in JavaScript - forEach, join, reduce, and toString methods."},{"slug":"free-web-hosting","title":"4 best free website hosting sites for Javascript developers (no credit card required)","author":{"name":"Suraj Sharma","picture":""},"date":"2020-08-21T00:00:00.000Z","url":"free-web-hosting","hashtags":"#javascript","excerpt":"From Github Pages to Netlify, 4 best free websites hosting sites for Javascript developers."}]},"__N_SSG":true}