{"pageProps":{"posts":[{"slug":"few-shot-learning-with-prompts","title":"Few-Shot Learning with Prompts: Providing Examples Within Prompts for Better Results","excerpt":"Learn how few-shot learning with prompts can improve AI responses, with practical tech examples and personal insights.","author":{"name":"Suraj Sharma","picture":""},"date":"2024-10-23T00:00:00.000Z"},{"slug":"advanced-prompt-technique","title":"Advanced Prompt Techniques: Using Instructions, Constraints, and Examples","excerpt":"Learn advanced prompt techniques like using instructions, constraints, and examples to get better AI responses, with personal insights.","author":{"name":"Suraj Sharma","picture":""},"date":"2024-10-22T00:00:00.000Z"},{"slug":"ethical-considerations-for-beginners","title":"Ethical Considerations for Beginners: Introduction to Ethics in AI Interactions","excerpt":"Learn about the ethical considerations in AI interactions for beginners, with real-world examples.","author":{"name":"Suraj Sharma","picture":""},"date":"2024-10-08T00:00:00.000Z"},{"slug":"simple-use-cases-of-prompt-engineering","title":"Simple Use Cases of Prompt Engineering: Examples like Summarization and Translation","excerpt":"Learn about simple use cases of prompt engineering, like summarization and translation, with practical examples.","author":{"name":"Suraj Sharma","picture":""},"date":"2024-10-07T00:00:00.000Z"},{"slug":"guiding-tone-and-style-through-prompts","title":"Guiding Tone and Style through Prompts: Influencing the AI Writing Style","excerpt":"Learn how to influence the AI writing style by guiding tone and style through prompts, with practical examples and personal insights.","author":{"name":"Suraj Sharma","picture":""},"date":"2024-10-06T20:00:00.000Z"},{"slug":"using-questions-vs-statements-in-prompts","title":"Using Questions vs. Statements: Different Prompt Formats and Their Effects","excerpt":"Learn how using questions and statements in prompts can affect AI responses, with practical examples.","author":{"name":"Suraj Sharma","picture":""},"date":"2024-10-06T00:00:00.000Z"},{"slug":"the-role-of-context-in-prompts","title":"The Role of Context in Prompts: How Providing Context Influences Output","excerpt":"Learn how providing context in your prompts can influence AI output, with detailed examples and personal insights.","author":{"name":"Suraj Sharma","picture":""},"date":"2024-10-05T10:00:00.000Z"},{"slug":"common-mistakes-in-prompt-writing","title":"Common Mistakes in Prompt Writing: Pitfalls to Avoid for Better AI Responses","excerpt":"Learn about common mistakes in prompt writing and how to avoid them for better AI responses, with personal examples.","author":{"name":"Suraj Sharma","picture":""},"date":"2024-10-05T00:00:00.000Z"},{"slug":"key-elements-of-effective-prompts","title":"Key Elements of Effective Prompts: Clarity, Context, and Specificity in Prompt Design","excerpt":"Learn about the key elements of effective prompts—clarity, context, and specificity—with personal examples.","author":{"name":"Suraj Sharma","picture":""},"date":"2024-10-03T00:00:00.000Z"},{"slug":"getting-started-with-writing-prompts","title":"Getting Started with Writing Prompts: Crafting Your First Prompts and Simple Techniques","excerpt":"Learn how to write effective prompts and some simple techniques to get the best responses from AI models like GPT-4o.","author":{"name":"Suraj Sharma","picture":""},"date":"2024-09-30T00:00:00.000Z"},{"slug":"basics-of-llms","title":"How LLMs Like GPT-4o Process and Generate Text","excerpt":"Learn the basics of large language models and how models like GPT-4o process and generate text.","author":{"name":"Suraj Sharma","picture":""},"date":"2024-09-29T00:00:00.000Z"},{"slug":"get-started-with-prompt-engineering","title":"How to get started with prompt engineering: Understanding Its Importance in AI","excerpt":"An introductory guide on prompt engineering, explaining how to craft effective prompts for AI models like GPT-4o, with practical examples and code snippets.","author":{"name":"Suraj Sharma","picture":""},"date":"2024-09-28T00:00:00.000Z"},{"slug":"cypress-check-if-element-is-clickable","title":"How to check if an element is clickable in Cypress","excerpt":"Learn how you can check if an element is clickable in Cypress","author":{"name":"Suraj Sharma","picture":""},"date":"2023-03-05T01:00:00.000Z"},{"slug":"cypress-get-text-of-an-element","title":"How to get text of an element in Cypress","excerpt":"Learn how you can get the text content of an html element in Cypress","author":{"name":"Suraj Sharma","picture":""},"date":"2023-03-05T00:00:00.000Z"},{"slug":"golang-make-api-calls","title":"How to make api calls in Golang","excerpt":"Learn to make GET and POST requests to external APIs in Golang","author":{"name":"Suraj Sharma","picture":""},"date":"2023-03-04T00:00:00.000Z"},{"slug":"axios-delete-request","title":"How to send a delete request in axios","excerpt":"Learn how to send a delete request in javaScript using axios","author":{"name":"Suraj Sharma","picture":""},"date":"2022-12-16T00:00:00.000Z"},{"slug":"convert-positive-to-negative-in-javascript","title":"How to convert a positive number to negative in JavaScript","excerpt":"Learn to convert a postive number to a negative number in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2022-12-15T00:00:00.000Z"},{"slug":"golang-add-key-to-map","title":"How to add a key to a map in Golang","excerpt":"Learn how to safely add a key to a map in Golang","author":{"name":"Suraj Sharma","picture":""},"date":"2022-10-22T00:00:00.000Z"},{"slug":"golang-find-type-of-variables","title":"How to find the type of a variable in Golang","excerpt":"Learn two ways to find the type of a variable in Golang","author":{"name":"Suraj Sharma","picture":""},"date":"2022-10-21T00:00:00.000Z"},{"slug":"express-server-close-connections","title":"How to stop server to accept new connections in Express","excerpt":"Learn how to stop server from accepting new connections in Express","author":{"name":"Suraj Sharma","picture":""},"date":"2022-10-16T00:00:00.000Z"},{"slug":"react-material-ui-custom-font","title":"How to add a custom font in React Material UI","excerpt":"In this tutorial, I have discussed how you can add a custom font and override the React Material UI font.","author":{"name":"Suraj Sharma","picture":""},"date":"2022-10-15T17:00:00.000Z"},{"slug":"react-material-ui-dark-mode","title":"How to build a dark mode theme in React Material UI","excerpt":"A practical guide on how to create a custom ThemeProvider component to switch between light mode and dark mode theme in React material UI","author":{"name":"Suraj Sharma","picture":""},"date":"2022-10-15T12:00:00.000Z"},{"slug":"react-material-ui-detect-dark-mode","title":"How to detect dark mode theme in React Material UI","excerpt":"You will learn to apply React material ui useMediaQuery() hook to detect dark mode theme","author":{"name":"Suraj Sharma","picture":""},"date":"2022-10-15T02:00:00.000Z"},{"slug":"react-material-ui-create-custom-theme","title":"How to create a custom theme in React Material UI","excerpt":"Learn to create a customize theme in React Material UI","author":{"name":"Suraj Sharma","picture":""},"date":"2022-10-15T00:00:00.000Z"},{"slug":"react-material-ui-use-theme","title":"How to get React material ui theme object in function components","excerpt":"Learn to get the React Material UI theme object in function components using the useTheme hook","author":{"name":"Suraj Sharma","picture":""},"date":"2022-10-15T00:00:00.000Z"},{"slug":"react-material-ui-hide-autocomplete-clear-button","title":"How to hide clear button of Autocomplete in React Material UI","excerpt":"Learn to hide the clear button of Mui Autocomplete","author":{"name":"Suraj Sharma","picture":""},"date":"2022-10-11T00:00:00.000Z"},{"slug":"express-make-api-requests","title":"How to make API requests in Express","excerpt":"Learn to make API requests to external REST APIs in Express","author":{"name":"Suraj Sharma","picture":""},"date":"2022-10-09T00:00:00.000Z"},{"slug":"javascript-get-yesterday-date","title":"How to get yesterday date in JavaScript","excerpt":"Get yesterday date in vanilla JavaScript using Date object","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-24T00:00:00.000Z"},{"slug":"javascript-get-tomorrow-date","title":"How to get tomorrow date in JavaScript","excerpt":"Get tomorrow date in vanilla JavaScript using Date object","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-23T00:00:00.000Z"},{"slug":"javascript-get-current-date","title":"How to get current date in Javascript","excerpt":"Get current date in Javascript using the Date.toLocaleDateString method","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-21T00:00:00.000Z"},{"slug":"react-change-button-text-on-click","title":"How to change button text on click in React","excerpt":"This tutorial is about changing the text of button when clicked on it in React","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-20T13:00:00.000Z"},{"slug":"golang-check-if-map-is-empty","title":"How to check if a map is empty in Golang","excerpt":"Learn two ways to check if a map is empty in Golang","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-19T00:00:00.000Z"},{"slug":"golang-get-slice-of-keys-from-map","title":"How to get a slice of keys from a map in Golang","excerpt":"This tutorial is about getting a slice of keys from a map in golang","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-17T03:00:00.000Z"},{"slug":"react-get-file-size","title":"How to get the size of a file in React","excerpt":"Learn to get the size of an image file before uploading it to the server using React.js","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-16T00:00:00.000Z"},{"slug":"golang-interface-to-string","title":"How to convert an interface to a string in Golang","excerpt":"Convert a golang interface to a golang string using a built-in function","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-13T00:00:00.000Z"},{"slug":"golang-delete-map-key","title":"How to remove a key from a map in Golang","excerpt":"Remove an existing key from a map in Golang using a built-in delete function","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-12T00:00:00.000Z"},{"slug":"golang-string-has-prefix","title":"How to check if a string starts with a substring in Golang","excerpt":"Check if a string starts with a substring in Golang","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-11T00:00:00.000Z"},{"slug":"store-objects-with-localstorage","title":"How to store objects in HTML5 localStorage","excerpt":"Use the JSON.stringify method to store objects in HTML5 localStorage","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-10T00:00:00.000Z"},{"slug":"golang-exit-main-function","title":"How to exit from the main function in Golang","excerpt":"Learn to exit from the main program when an error occurs inside the main func in golang","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-09T00:00:00.000Z"},{"slug":"git-rename-branch","title":"How to renaming an existing branch in Git","excerpt":"Learn to rename an existing git branch","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-08T00:00:00.000Z"},{"slug":"react-disable-select-field","title":"How to disable a select field in React","excerpt":"Learn to disable a select field and its option in react using useState() hook and the disabled property","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-07T00:00:00.000Z"},{"slug":"javascript-iterate-through-string","title":"How to iterate through a string in JavaScript","excerpt":"Learn two ways to iterate through a string in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-05T00:00:00.000Z"},{"slug":"git-create-new-branch","title":"How to create a new local branch in Git","excerpt":"Learn to create a new local branch in git","author":{"name":"Suraj Sharma","picture":""},"date":"2022-09-04T00:00:00.000Z"},{"slug":"golang-convert-float-to-string","title":"How to convert a float to a string in Golang","excerpt":"Learn to convert a float64 or float32 to a string in golang","author":{"name":"Suraj Sharma","picture":""},"date":"2022-08-07T00:00:00.000Z"},{"slug":"golang-convert-float-to-int","title":"How to convert a float to an int in Golang","excerpt":"Learn to convert a float64 or float32 to an int in golang","author":{"name":"Suraj Sharma","picture":""},"date":"2022-08-03T00:00:00.000Z"},{"slug":"react-disable-link-tag","title":"How to disable a link tag in React","excerpt":"Learn to use css and javascript ways to disable link tags in React","author":{"name":"Suraj Sharma","picture":""},"date":"2022-08-02T00:00:00.000Z"},{"slug":"react-file-upload-accept-only-images","title":"How to accept only image files in react file upload","excerpt":"This tutorial will help to develop a react file upload component that accepts only image files","author":{"name":"Suraj Sharma","picture":""},"date":"2022-08-02T00:00:00.000Z"},{"slug":"bash-join-string-variables","title":"How to join string variables in Bash","excerpt":"this tutorial illustrates few examples to concatenate strings variables in Bash","author":{"name":"Suraj Sharma","picture":""},"date":"2022-07-29T00:00:00.000Z"},{"slug":"express-generate-uuid","title":"How to generate random uuid in Node and Express","excerpt":"Learn to generate random unique IDs in Node and Express","author":{"name":"Suraj Sharma","picture":""},"date":"2022-07-10T05:10:00.000Z"},{"slug":"golang-get-current-year","title":"How to get current year in Golang","excerpt":"Learn to get the current year in Golang","author":{"name":"Suraj Sharma","picture":""},"date":"2022-07-07T00:00:00.000Z"},{"slug":"javascript-get-current-year","title":"How to get current year in JavaScript","excerpt":"Get current year in JavaScript using the Date object","author":{"name":"Suraj Sharma","picture":""},"date":"2022-07-06T00:00:00.000Z"},{"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","excerpt":"Learn to remove all occurences of an element from an array in JavaScript in O(1) space complexity","author":{"name":"Suraj Sharma","picture":""},"date":"2022-06-18T00:00:00.000Z"},{"slug":"fix-docker-error-no-space-left-on-device","title":"How to fix docker error: no space left on device in Mac","excerpt":"Learn to fix docker error: no space left on device in Mac","author":{"name":"Suraj Sharma","picture":""},"date":"2022-06-14T00:00:00.000Z"},{"slug":"list-all-npm-installed-packages","title":"How to list all the installed NPM packages","excerpt":"Learn an NPM command to list all the installed npm packages on your system.","author":{"name":"Suraj Sharma","picture":""},"date":"2022-06-01T00:00:00.000Z"},{"slug":"delete-non-empty-directory-in-node","title":"How to delete a non-empty directory in Node.js","excerpt":"Learn to delete a non-empty directory in Node using the file system module","author":{"name":"Suraj Sharma","picture":""},"date":"2022-05-11T00:00:00.000Z"},{"slug":"javascript-check-if-value-is-number","title":"How to check if a value is a number in JavaScript","excerpt":"Learn two ways to check if a value is of number type in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2022-03-28T00:00:00.000Z"},{"slug":"react-create-csv-file","title":"How to create a csv file from response data in React","excerpt":"Create and export a csv file from the response data results in React using react-csv","author":{"name":"Suraj Sharma","picture":""},"date":"2022-01-20T00:00:00.000Z"},{"slug":"react-material-ui-set-typography-color","title":"How to change Typography color in React Material UI","excerpt":"Learn to set a different text color to the Typography component in React Material UI","author":{"name":"Suraj Sharma","picture":""},"date":"2021-11-03T00:00:00.000Z"},{"slug":"react-material-ui-add-typography-variants","title":"How to add custom typography variants in React material UI","excerpt":"Learn to create and use your own typography custom variants in your React Material UI","author":{"name":"Suraj Sharma","picture":""},"date":"2021-11-02T00:00:00.000Z"},{"slug":"javascript-get-index-of-an-item-in-array","title":"How to get index of an item in an array in JavaScript","excerpt":"Learn to find index of an item in a given array in JavaScript using arrays built-in methods","author":{"name":"Suraj Sharma","picture":""},"date":"2021-10-31T00:00:00.000Z"},{"slug":"react-upload-file-using-axios","title":"How to upload files in React using Axios","excerpt":"Learn to upload files in React using Axios post method","author":{"name":"Suraj Sharma","picture":""},"date":"2021-10-09T00:00:00.000Z"},{"slug":"react-handle-radio-buttons","title":"How to handle and manage radio buttons state in React","excerpt":"Learn to handle and manage radio buttons state in React without using any 3rd party form libraries","author":{"name":"Suraj Sharma","picture":""},"date":"2021-10-01T00:00:00.000Z"},{"slug":"golang-merge-slices","title":"How to merge two slices in Golang","excerpt":"Learn to merge two slices of the same type in Go using a built-in function","author":{"name":"Suraj Sharma","picture":""},"date":"2021-09-16T00:00:00.000Z"},{"slug":"javascript-spilt-string-into-words","title":"How to split a string into words in JavaScript","excerpt":"Learn to split a sentence into words in JavaScript using the string.split() method","author":{"name":"Suraj Sharma","picture":""},"date":"2021-09-15T00:00:00.000Z"},{"slug":"golang-initialize-slice-with-values","title":"How to initialize a slice with values in Golang","excerpt":"Learn to initialize a new slice with initial values in Golang using a composite literal","author":{"name":"Suraj Sharma","picture":""},"date":"2021-09-06T00:00:00.000Z"},{"slug":"axios-post-form-data","title":"How to submit form data in post request using axios","excerpt":"Learn to submit form data in HTTP post request using axios","author":{"name":"Suraj Sharma","picture":""},"date":"2021-08-01T00:00:00.000Z"},{"slug":"golang-check-if-slice-is-empty","title":"How to check if a slice is empty in Golang","excerpt":"Learn to check if a slice is empty in Golang using the len() method","author":{"name":"Suraj Sharma","picture":""},"date":"2021-07-31T00:00:00.000Z"},{"slug":"javascript-random-strings","title":"How to randomly generate alphanumeric strings in JavaScript","excerpt":"Learn about generating random alphanumeric strings in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-30T00:00:00.000Z"},{"slug":"golang-map-contains-key","title":"How to check if a map contains a key in Golang","excerpt":"Learn to check if a map contains a key in Golang","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-28T00:00:00.000Z"},{"slug":"react-clear-input-fields","title":"How to reset input fields in React","excerpt":"Learn how you can reset input fields in controlled components and in uncontrolled components","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-27T00:00:00.000Z"},{"slug":"golang-multiline-strings","title":"How do you write multi-line strings in Golang","excerpt":"Learn to write multi-line strings in your Golang code","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-26T01:00:00.000Z"},{"slug":"golang-is-file-exists","title":"How to check if a file exists in Golang","excerpt":"Learn to check if a file with a given file path exists in Golang 1.16","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-26T00:00:00.000Z"},{"slug":"golang-read-text-file","title":"How to read a text file in Golang","excerpt":"Learn to read a text file in Golang using the ioutil.ReadFile function","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-25T00:00:00.000Z"},{"slug":"golang-ints-are-sorted-func","title":"How to check if an array of int values are sorted in Golang","excerpt":"Learn to check if an array of int values are sorted in increasing order in Golang","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-23T03:00:00.000Z"},{"slug":"golang-strings-contains-func","title":"How check if a string contains a substring in Golang","excerpt":"Learn to use strings.Contains function in Golang to check whether a given string contains a substring or not","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-22T00:00:00.000Z"},{"slug":"golang-create-map","title":"How to create a map in Golang","excerpt":"Learn to create and initialize a map of key-value pairs in Golang using the built-in make function","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-20T00:00:00.000Z"},{"slug":"golang-initialize-slice","title":"How to initialize a slice in Golang","excerpt":"Learn to create and initialize a slice of structs in Golang using built-in make function","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-19T03:00:00.000Z"},{"slug":"golang-json-to-struct","title":"How to convert a JSON to a Struct in Golang","excerpt":"Learn to convert a JSON string to a struct using a package json UnMarshal function","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-19T02:00:00.000Z"},{"slug":"golang-struct-to-json","title":"How to convert a Struct to a JSON in Golang","excerpt":"Learn to convert a struct to a JSON using a package json Marshal function","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-19T00:00:00.000Z"},{"slug":"javascript-float-to-integer","title":"How to convert a float to an integer in JavaScript","excerpt":"Learn to use various JavaScript Math methods to convert a float number to an integer number","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-16T00:00:00.000Z"},{"slug":"react-router-default-route","title":"How to set a default route in React Router","excerpt":"Learn to set a default route in React Router using the Redirect component","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-15T12:00:00.000Z"},{"slug":"react-router-dom-pass-data","title":"How to pass state data in React Router","excerpt":"Learn how you can pass data between the routes using the react-router-dom library","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-15T00:00:00.000Z"},{"slug":"react-material-ui-import-icons","title":"How to use Material UI icons in React Material UI","excerpt":"Learn to import and use material-ui icons in React components","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-14T08:00:00.000Z"},{"slug":"react-disable-input-field","title":"How to conditionally disable an input field in React","excerpt":"Learn to conditonally disable an input field in React","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-14T00:00:00.000Z"},{"slug":"javascript-array-sort-alphanumeric","title":"How to sort an array of alphanumeric strings in JavaScript","excerpt":"Learn to sort an array of alphanumeric values in JavaScript using the String.localeCompare() method","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-13T00:00:00.000Z"},{"slug":"react-conditional-routing","title":"How to achieve conditional routing in React","excerpt":"Learn to conditionally route between components in React using react-router-dom","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-11T00:00:00.000Z"},{"slug":"react-material-ui-add-classes","title":"How to add multiple class names in React Material UI","excerpt":"Learn to add multiple class names in React Material UI using clsx library","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-08T00:00:00.000Z"},{"slug":"javascript-get-first-n-elements-of-array","title":"How to get first N elements of an array in JavaScript","excerpt":"Get first N number of elements of an array in JavaScript in two simple ways","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-07T00:00:00.000Z"},{"slug":"react-pass-arguments-to-event-handlers","title":"How to pass arguments to event handlers in React","excerpt":"Learn to pass one or arguments to event handler functions in React","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-06T00:00:00.000Z"},{"slug":"javascript-loop-through-object","title":"How to loop through an object in JavaScript","excerpt":"Learn two ways to iterate through an object in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-05T00:00:00.000Z"},{"slug":"javascript-remove-empty-objects-from-array","title":"How to remove empty objects from an array in JavaScript","excerpt":"Learn to remove empty objects and empty arrays from an array in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-04T00:00:00.000Z"},{"slug":"javascript-check-for-empty-object","title":"How to check for an empty object in JavaScript","excerpt":"Learn Two ways to check if a JavaScript object is empty","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-03T00:00:00.000Z"},{"slug":"javascript-multiple-conditions-switch-case","title":"How to write multiple conditions with a switch case in JavaScript","excerpt":"Write multiple OR conditions with a single switch case statement in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-02T00:00:00.000Z"},{"slug":"javascript-array-remove-empty-elements","title":"How to remove empty elements of an array in JavaScript","excerpt":"Learn to remove empty and falsy elements of an array in JavaScript using Array.filter method","author":{"name":"Suraj Sharma","picture":""},"date":"2021-06-01T00:00:00.000Z"},{"slug":"react-onkeypress-form-submit","title":"How to trigger button onclick event on Enter key press in React","excerpt":"Learn to submit a React form by triggering submit button click on Enter key press","author":{"name":"Suraj Sharma","picture":""},"date":"2021-05-30T00:00:00.000Z"},{"slug":"javascript-find-index-in-array-of-objects","title":"How to find index in an array of objects in JavaScript","excerpt":"Learn how you can find index of an item in an array of object in JavaScript using Array.findIndex() method","author":{"name":"Suraj Sharma","picture":""},"date":"2021-05-29T00:00:00.000Z"},{"slug":"conditionally-apply-classes-in-react","title":"How to conditionally apply class names in React JS","excerpt":"A couple of approaches to condtionally apply class names in React JS","author":{"name":"Suraj Sharma","picture":""},"date":"2021-05-28T00:00:00.000Z"},{"slug":"react-conditional-props","title":"How to conditionally add props to React component","excerpt":"Learn to conditionally add or remove props to React components using JavaScript ternary operator","author":{"name":"Suraj Sharma","picture":""},"date":"2021-05-28T00:00:00.000Z"},{"slug":"google-analytics-nextjs-website","title":"How to add google analytics to a Next.js app","excerpt":"In this tutorial, you will learn 3 ways to add google analytics to your Next.js app","author":{"name":"Suraj Sharma","picture":""},"date":"2021-05-27T00:00:00.000Z"},{"slug":"javascript-function-return-multiple-values","title":"How to return multiple values from a JavaScript function","excerpt":"In this tutorial, you’ll learn how you can return multiple values from a JavaScript function using Array destructuring and object destructuring.","author":{"name":"Suraj Sharma","picture":""},"date":"2021-05-27T00:00:00.000Z"},{"slug":"javascript-key-exists-in-object","title":"How to check if a key exists in a JavaScript object","excerpt":"Learn 2 way to check if a key exists in given JavaScript object","author":{"name":"Suraj Sharma","picture":""},"date":"2021-05-26T00:00:00.000Z"},{"slug":"axios-set-headers","title":"How to set HTTP headers in Axios","excerpt":"Learn 2 different ways to set HTTP headers in Axios","author":{"name":"Suraj Sharma","picture":""},"date":"2021-05-25T00:00:00.000Z"},{"slug":"react-url-query-params","title":"How to get query string of a current URL in React","excerpt":"Learn to create a custom hook to get query string of a URL in React","author":{"name":"Suraj Sharma","picture":""},"date":"2021-05-23T00:00:00.000Z"},{"slug":"nextjs-custom-404-page","title":"How to customize 404 error page in Next.js","excerpt":"Create a custom page not found (404) error page in Next.js","author":{"name":"Suraj Sharma","picture":""},"date":"2021-05-22T00:00:00.000Z"},{"slug":"react-update-parent-state-from-child","title":"How to update parent state from child in React","excerpt":"Learn to update parent component state from child components in React","author":{"name":"Suraj Sharma","picture":""},"date":"2021-05-21T00:00:00.000Z"},{"slug":"add-favicon-in-nextjs","title":"How to add favicon in Next.js","excerpt":"Learn to add a favicon to your Next.js application","author":{"name":"Suraj Sharma","picture":""},"date":"2021-05-20T00:00:00.000Z"},{"slug":"nextjs-server-side-redirect","title":"How to do a 301 server side redirect in Next.js","excerpt":"Do a server side redirect in Next.js and React using the nodeJS response.writeHead() method","author":{"name":"Suraj Sharma","picture":""},"date":"2021-05-20T00:00:00.000Z"},{"slug":"auto-focus-input-element-in-react","title":"How to autofocus an input element in React using useRef() hook","excerpt":"Learn to focus JSX elements in React function component using the useRef() hook","author":{"name":"Suraj Sharma","picture":""},"date":"2021-01-03T20:00:00.000Z"},{"slug":"express-get-query-params","title":"How to get query string params using Node and Express","excerpt":"Get the query string params in express using the Request.query property","author":{"name":"Suraj Sharma","picture":""},"date":"2020-12-20T05:10:00.000Z"},{"slug":"javascript-ascii-code","title":"How to convert ASCII code to a character in JavaScript","excerpt":"Convert ASCII code to sting and character and vice versa in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-12-07T12:10:00.000Z"},{"slug":"react-call-parent-method-in-child","title":"Call parent component method in a child component in React and Typescript","excerpt":"How to call a parent component method in a child component in React and Typescript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-12-05T02:00:00.000Z"},{"slug":"react-embed-videos","title":"How to embed a Youtube video in React","excerpt":"Embed a Youtube, Facebook, Twitch or any other external video on your React app using react-player","author":{"name":"Suraj Sharma","picture":""},"date":"2020-12-02T08:00:00.000Z"},{"slug":"pass-props-to-makestyles","title":"How to pass props to the makeStyles API in React Material UI","excerpt":"Learn how to pass a component props to the makeStyles API in React Material UI that dynamically change the style property","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-29T12:00:00.000Z"},{"slug":"react-component-as-props-typescript","title":"How to pass React components as props in TypeScript","excerpt":"Learn how you can pass an entire component as props in React and TypeScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-29T07:00:00.000Z"},{"slug":"javascript-array-get-last-element","title":"How to get the last element of an Array in JavaScript","excerpt":"In this tutorial, I have discussed 2 ways to get the last element of an Array in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-26T12:00:00.000Z"},{"slug":"react-scroll-to-bottom","title":"How to scroll to the bottom of JSX elements in React","excerpt":"How to scroll to the bottom of a JSX element using useRef() hook","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-25T09:00:00.000Z"},{"slug":"react-scroll-to-top","title":"How to scroll to top of the page in React","excerpt":"Scroll to the top of the page in React using useEffect() react hook","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-22T09:00:00.000Z"},{"slug":"react-type-function-components","title":"How to write React function components in Typescript","excerpt":"Learn to write strongly type React function components in TypeScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-21T06:00:00.000Z"},{"slug":"javascript-detect-dark-mode","title":"How to detect if dark mode is enabled on a browser using 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","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-20T02:00:00.000Z"},{"slug":"is-javascript-array-empty","title":"How to check if an array is empty in JavaScript","excerpt":"Learn the easiest way to find whether the given array is empty or not","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-18T12:00:00.000Z"},{"slug":"javascript-array-remove-first-element","title":"How to remove the first element of an array in JavaScript","excerpt":"Learn to use Array.shift() method and array destructuring to remove the first element of an array in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-17T12:00:00.000Z"},{"slug":"is-javascript-object-an-array","title":"How to check if an object is an array in JavaScript","excerpt":"Learn how you can use Array.isArray method to check if an object is an array in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-16T12:00:00.000Z"},{"slug":"javascript-array-unshift-method","title":"How to add an element at the beginning of an array in JavaScript","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","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-15T12:10:00.000Z"},{"slug":"react-submit-login-form","title":"How to submit a login form in React using React hook","excerpt":"Learn how to submit a controlled login form in React using html form onSubmit attribute","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-15T00:00:00.000Z"},{"slug":"javascript-remove-substring","title":"How to remove a particular substring from a string in javascript","excerpt":"Learn to use the replace() and the split() method to remove a substring from a string in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-14T06:00:00.000Z"},{"slug":"react-show-hide-component","title":"How to show and hide components in React using React Hook","excerpt":"Learn to conditionally show and hide components in React using useState hook","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-08T10:30:00.000Z"},{"slug":"import-css-in-react","title":"How to import CSS from the public folder in React","excerpt":"Import a css file from the public folder in React","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-07T10:00:00.000Z"},{"slug":"react-material-ui-typography-bold","title":"How to make React Material UI Typography bold","excerpt":"Learn to change the font-weight of the React Material UI Typography component to bold","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-07T08:00:00.000Z"},{"slug":"react-material-ui-font-family","title":"How to change font family of typography in React Material UI","excerpt":"Learn to change the font family of React Material UI Typography","author":{"name":"Suraj Sharma","picture":""},"date":"2020-11-02T08:00:00.000Z"},{"slug":"react-add-item-to-list","title":"How to add an item to a list in React","excerpt":"Learn to add an item to a state Array in React using the spread operator and the concat method","author":{"name":"Suraj Sharma","picture":""},"date":"2020-10-02T13:00:00.000Z"},{"slug":"render-list-in-react","title":"How to render a list of items in React","excerpt":"Learn to render a list of items in React using the Array.map() method","author":{"name":"Suraj Sharma","picture":""},"date":"2020-10-02T08:00:00.000Z"},{"slug":"boolean-to-string-javascript","title":"How to convert a boolean to a string in JavaScript","excerpt":"Learn to convert a boolean to a string in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-30T23:00:00.000Z"},{"slug":"convert-string-to-boolean-javascript","title":"How to convert a string to a boolean in JavaScript","excerpt":"Learn to convert a string to a boolean in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-27T14:00:00.000Z"},{"slug":"background-image-in-react","title":"How to set a background image from the public folder in React","excerpt":"In this tutorial, I have discussed what the best way to set a /public folder image as a background image in React JSX","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-26T14:00:00.000Z"},{"slug":"remove-last-character-javascript-string","title":"How to remove the last character of a string in JavaScript","excerpt":"In this tutorial, you will learn to remove the last character of a JavaScript string using the substring() and the slice() methods","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-24T17:00:00.000Z"},{"slug":"error-handling-in-javascript-async-await","title":"How to handle an error in async await in JavaScript","excerpt":"In this tutorial, you will learn to handle an error in JavaScript async await","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-24T15:00:00.000Z"},{"slug":"break-out-of-foreach-javascript","title":"How to break out of the Array forEach method in JavaScript","excerpt":"In this tutorial, you will learn to break out of the array.forEach method in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-24T01:00:00.000Z"},{"slug":"javascript-array-first-element","title":"How to get the first element of an array in JavaScript","excerpt":"In this tutorial, I have discussed 3 ways to get the first element of a JavaScript array","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-24T00:00:00.000Z"},{"slug":"current-url-in-react","title":"How to get the current URL and pathname in React","excerpt":"In this tutorial, I have discussed different ways to get the current URL and pathname in React - uselocation hook and window.location object","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-21T00:00:00.000Z"},{"slug":"check-object-in-javascript-array","title":"How to check if a value exists in an array of objects in JavaScript","excerpt":"2 JavaScript Array methods to check if a value is present in an array of objects; some() and find() methods.","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-17T00:00:00.000Z"},{"slug":"deploy-react-app-to-github-pages","title":"How to deploy a create React app to Github pages for free","excerpt":"A practical guide on how to deploy or host your React app on Github Pages for free using 6 simple steps.","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-16T12:00:00.000Z"},{"slug":"disable-button-in-react","title":"How to disable a Button when an Input field is Empty in React","excerpt":"In this tutorial, I have discussed how you can use disabled attribute of a button element to disable the button when an input field is empty in React","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-16T00:00:00.000Z"},{"slug":"javascript-string-starts-with","title":"How to check if a string starts with substring in JavaScript","excerpt":"In this tutorial, I have discussed 4 ways to check if a JavaScript string starts with a substring","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-14T12:00:00.000Z"},{"slug":"javascript-array-includes-value","title":"How to check if an Array includes a value in JavaScript","excerpt":"In this tutorial, I have discussed 5 ways to check if an JavaScript array includes a value","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-12T12:00:00.000Z"},{"slug":"decimal-to-hexadecimal-javascript","title":"How to convert a Decimal to a Hexadecimal in 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.","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-10T00:00:00.000Z"},{"slug":"react-login-form-typescript","title":"How to build a React Login Form with Typescript and React hooks","excerpt":"A practical guide on how you can create a react login form and form validation with Typescript, React hooks and Material UI","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-09T00:00:00.000Z"},{"slug":"string-contains-substring-javascript","title":"How to check if a string contains a substring in JavaScript","excerpt":"In this tutorial, I have discussed how to check if a sting contains a substring in JavaScript using includes() and indexOf() methods","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-08T00:00:00.000Z"},{"slug":"merge-arrays-in-javascript","title":"How to merge two or more arrays in JavaScript","excerpt":"In this tutorial, I have discussed two ways to merge two or more arrays in JavaScript","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-07T22:00:00.000Z"},{"slug":"change-port-in-svelte","title":"How to change the default port of a Svelte.js app","excerpt":"I have discussed two ways to change the default port of a Svelte app","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-07T17:00:00.000Z"},{"slug":"uppercase-first-letter-in-javascript","title":"How to uppercase the First Letter of a String in JavaScript","excerpt":"Uppercase the first letter of a sting in JavaScript using slice() and toUpperCase() methods","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-07T00:00:00.000Z"},{"slug":"meta-title-tag-in-react","title":"How to dynamically set Meta Title Tag in React","excerpt":"Created a custom React component with React Helmet to dynamically set a page meta title tag.","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-06T00:00:00.000Z"},{"slug":"repeat-string-in-javascript","title":"How to Repeat a String in JavaScript","excerpt":"4 best ways to repeat a string for N number of times in JavaScript, using Array.join(), string.repeat(), for loop, and recursion","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-05T14:03:00.000Z"},{"slug":"array-to-string-in-javascript","title":"How to convert an Array to a String in JavaScript","excerpt":"4 different ways to convert an array to a string in JavaScript - forEach, join, reduce, and toString methods.","author":{"name":"Suraj Sharma","picture":""},"date":"2020-09-03T14:00:00.000Z"},{"slug":"conditional-rendering-in-react","title":"How to conditionally render React components using React hooks","excerpt":"You will learn 3 ways to conditionally render components in React","author":{"name":"Suraj Sharma","picture":""},"date":"2020-08-29T23:00:00.000Z"},{"slug":"for-loop-in-react","title":"How to loop through an array of objects in React","excerpt":"for-of loop and array.map() method, a practical guide on how to loop through an array of objects in React","author":{"name":"Suraj Sharma","picture":""},"date":"2020-08-26T00:00:00.000Z"},{"slug":"free-web-hosting","title":"4 best free website hosting sites for Javascript developers (no credit card required)","excerpt":"From Github Pages to Netlify, 4 best free websites hosting sites for Javascript developers.","author":{"name":"Suraj Sharma","picture":""},"date":"2020-08-21T00:00:00.000Z"},{"slug":"personal-blog-built-using-nextjs-and-typescript","title":"Personal Blog Built using Nextjs and TypeScript","excerpt":"Things to consider when building a personal blog website with React","author":{"name":"Suraj Sharma","picture":""},"date":"2020-04-12T00:00:00.000Z"}]},"__N_SSG":true}