{"id":100193,"date":"2026-02-04T18:03:28","date_gmt":"2026-02-04T12:33:28","guid":{"rendered":"https:\/\/www.guvi.in\/blog\/?p=100193"},"modified":"2026-03-07T17:25:40","modified_gmt":"2026-03-07T11:55:40","slug":"callback-function-in-javascript","status":"publish","type":"post","link":"https:\/\/www.guvi.in\/blog\/callback-function-in-javascript\/","title":{"rendered":"What is a Callback Function in JavaScript?"},"content":{"rendered":"\n<p>If you\u2019ve been learning JavaScript for a while, you\u2019ve probably come across the term callback function. It shows up in array methods, event handlers, timers, and almost every discussion about asynchronous JavaScript. At first, it can feel abstract or even unnecessary. Why pass a function into another function at all?<\/p>\n\n\n\n<p>Here\u2019s the thing. Callback functions are not an advanced trick. They are a core idea in JavaScript that explains how the language handles tasks, timing, and control flow. Once you truly understand callbacks, concepts like promises, async\/await, and event-driven programming start to make much more sense.<\/p>\n\n\n\n<p>In this article, you\u2019ll learn what a callback function is, why it exists, how it works under the hood, and where you\u2019ll use it in real-world JavaScript code. So, without further ado, let us get started!<\/p>\n\n\n\n<p><strong>Quick Answer:<\/strong><\/p>\n\n\n\n<p>A callback function in JavaScript is a function passed as an argument to another function and executed later, usually after a task completes. It is commonly used to handle asynchronous operations like events, timers, and API responses without blocking the program flow.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What Is a Callback Function in JavaScript?<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"630\" src=\"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/What-is-a-Callback-Function-in-JavaScript_-1200x630.webp\" alt=\"What Is a Callback Function in JavaScript?\" class=\"wp-image-103242\" srcset=\"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/What-is-a-Callback-Function-in-JavaScript_-1200x630.webp 1200w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/What-is-a-Callback-Function-in-JavaScript_-300x158.webp 300w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/What-is-a-Callback-Function-in-JavaScript_-768x403.webp 768w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/What-is-a-Callback-Function-in-JavaScript_-1536x806.webp 1536w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/What-is-a-Callback-Function-in-JavaScript_-2048x1075.webp 2048w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/What-is-a-Callback-Function-in-JavaScript_-150x79.webp 150w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" title=\"\"><\/figure>\n\n\n\n<p>A callback function in <a href=\"https:\/\/www.guvi.in\/hub\/javascript\/\" target=\"_blank\" rel=\"noreferrer noopener\">JavaScript<\/a> is a function that is passed as an argument to another function and is executed later.<\/p>\n\n\n\n<p>Instead of calling a function immediately, you hand it over to another function and say, \u201cCall this back when you\u2019re done.\u201d<\/p>\n\n\n\n<p>In simple terms:<\/p>\n\n\n\n<ul>\n<li>One function takes responsibility for <em>when<\/em> something happens.<\/li>\n\n\n\n<li>The callback function defines <em>what<\/em> should happen next.<\/li>\n<\/ul>\n\n\n\n<p><strong>A Simple Definition:<\/strong><\/p>\n\n\n\n<p>You can think of a callback as:<em> A function that runs after another function completes its task.<\/em><\/p>\n\n\n\n<p>This idea might feel strange if you\u2019re used to writing code line by line. But in JavaScript, this pattern is everywhere.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Why Does JavaScript Use Callback Functions?<\/strong><\/h2>\n\n\n\n<p>JavaScript was designed to run in environments where waiting is expensive. Browsers shouldn\u2019t freeze while waiting for a file to load or an API to respond. Servers shouldn\u2019t block thousands of users while one task finishes.<\/p>\n\n\n\n<p>Callbacks solve this problem.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Key Reasons Callbacks Exist<\/strong><\/h3>\n\n\n\n<ul>\n<li>JavaScript is single-threaded. It can do only one thing at a time. Callbacks help it manage tasks efficiently without blocking execution.<\/li>\n\n\n\n<li>Handling asynchronous operations. Tasks like fetching data, reading files, or waiting for user input don\u2019t complete instantly.<\/li>\n\n\n\n<li>Flexible control flow. Callbacks let you decide what happens <em>after<\/em> a task finishes, instead of guessing when it will finish.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Understanding Callbacks with a Basic Example<\/strong><\/h2>\n\n\n\n<p>Let\u2019s start with a very simple synchronous example.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function greet(name, callback) {\n\n&nbsp;&nbsp;console.log(\"Hello \" + name);\n\n&nbsp;&nbsp;callback();\n\n}\n\nfunction sayGoodbye() {\n\n&nbsp;&nbsp;console.log(\"Goodbye!\");\n\n}\n\ngreet(\"Kiran\", sayGoodbye);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What\u2019s Happening Here?<\/strong><\/h3>\n\n\n\n<ul>\n<li>greet is a function that accepts two parameters:\n<ul>\n<li>name<\/li>\n\n\n\n<li>callback (which is a function)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Inside greet, we log a message.<\/li>\n\n\n\n<li>Then we call callback().<\/li>\n<\/ul>\n\n\n\n<p>The key idea is this: sayGoodbye is not executed immediately when it\u2019s passed. It\u2019s executed only when greet decides to call it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Functions Are First-Class Citizens in JavaScript<\/strong><\/h2>\n\n\n\n<p>To understand callbacks deeply, you need to understand one core concept.<\/p>\n\n\n\n<p>In JavaScript, <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Guide\/Functions\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">functions<\/a> are first-class citizens.<\/p>\n\n\n\n<p>This means:<\/p>\n\n\n\n<ul>\n<li>Functions can be stored in variables<\/li>\n\n\n\n<li>Functions can be passed as arguments<\/li>\n\n\n\n<li>Functions can be returned from other functions<\/li>\n<\/ul>\n\n\n\n<p><strong>Example<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const add = function (a, b) {\n\n&nbsp;&nbsp;return a + b;\n\n};\n\nfunction calculate(x, y, operation) {\n\n&nbsp;&nbsp;return operation(x, y);\n\n}\n\nconsole.log(calculate(5, 3, add));<\/code><\/pre>\n\n\n\n<p>Here, add is a callback function passed into calculate.<\/p>\n\n\n\n<p>This flexibility is what makes callbacks possible and powerful.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Synchronous vs Asynchronous Callbacks<\/strong><\/h2>\n\n\n\n<p>Not all callbacks behave the same way. Understanding this difference is crucial.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Synchronous Callback Functions<\/strong><\/h3>\n\n\n\n<p>A synchronous callback is executed immediately during the execution of the main function.<\/p>\n\n\n\n<p><strong>Example: Array Methods<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const numbers = &#91;1, 2, 3, 4];\n\nnumbers.forEach(function (num) {\n\n&nbsp;&nbsp;console.log(num);\n\n});<\/code><\/pre>\n\n\n\n<p>Here:<\/p>\n\n\n\n<ul>\n<li>forEach takes a callback function.<\/li>\n\n\n\n<li>The callback runs immediately for each element.<\/li>\n\n\n\n<li>The code executes in order, without waiting.<\/li>\n<\/ul>\n\n\n\n<p><strong>Common Synchronous Callback Examples<\/strong><\/p>\n\n\n\n<ul>\n<li>forEach()<\/li>\n\n\n\n<li>map()<\/li>\n\n\n\n<li>filter()<\/li>\n\n\n\n<li>reduce()<\/li>\n\n\n\n<li>sort()<\/li>\n<\/ul>\n\n\n\n<p>These callbacks help you process data step by step.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Asynchronous Callback Functions<\/strong><\/h3>\n\n\n\n<p>Asynchronous callbacks are executed later, after an operation completes. This is where callbacks become especially important.<\/p>\n\n\n\n<p><strong>Example: setTimeout<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>console.log(\"Start\");\n\nsetTimeout(function () {\n\n&nbsp;&nbsp;console.log(\"This runs later\");\n\n}, 2000);\n\nconsole.log(\"End\");<\/code><\/pre>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<p>Start<\/p>\n\n\n\n<p>End<\/p>\n\n\n\n<p>This runs later<\/p>\n\n\n\n<p>Even though setTimeout appears in the middle, its callback runs after 2 seconds.<\/p>\n\n\n\n<p>That\u2019s asynchronous behavior.<\/p>\n\n\n\n<p><strong><em>Learn More: <\/em><\/strong><a href=\"https:\/\/www.guvi.in\/blog\/best-javascript-practices-for-developers\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong><em>10 Best JavaScript Practices Every Developer Must Follow<\/em><\/strong><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Real-World Use Cases of Callback Functions<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"630\" src=\"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/Real-World-Use-Cases-of-Callback-Functions-1200x630.webp\" alt=\"Real-World Use Cases of Callback Functions\" class=\"wp-image-103243\" srcset=\"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/Real-World-Use-Cases-of-Callback-Functions-1200x630.webp 1200w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/Real-World-Use-Cases-of-Callback-Functions-300x158.webp 300w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/Real-World-Use-Cases-of-Callback-Functions-768x403.webp 768w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/Real-World-Use-Cases-of-Callback-Functions-1536x806.webp 1536w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/Real-World-Use-Cases-of-Callback-Functions-2048x1075.webp 2048w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/03\/Real-World-Use-Cases-of-Callback-Functions-150x79.webp 150w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" title=\"\"><\/figure>\n\n\n\n<p>Callbacks aren\u2019t theoretical. You use them constantly, even if you don\u2019t realize it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Event Handling<\/strong><\/h3>\n\n\n\n<p>One of the most common uses of callbacks is event handling.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>button.addEventListener(\"click\", function () {\n\n&nbsp;&nbsp;console.log(\"Button clicked\");\n\n});<\/code><\/pre>\n\n\n\n<p>Here:<\/p>\n\n\n\n<ul>\n<li>You don\u2019t know when the user will click.<\/li>\n\n\n\n<li>You provide a callback.<\/li>\n\n\n\n<li>The browser calls it at the right time.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. API Requests (Traditional Approach)<\/strong><\/h3>\n\n\n\n<p>Before promises became popular, callbacks were the primary way to handle API responses.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function fetchData(callback) {\n\n&nbsp;&nbsp;setTimeout(() =&gt; {\n\n&nbsp;&nbsp;&nbsp;&nbsp;callback(\"Data received\");\n\n&nbsp;&nbsp;}, 1000);\n\n}\n\nfetchData(function (response) {\n\n&nbsp;&nbsp;console.log(response);\n\n});<\/code><\/pre>\n\n\n\n<p>The callback runs only after the data is ready.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. File Handling in Node.js<\/strong><\/h3>\n\n\n\n<p>In <a href=\"https:\/\/www.guvi.in\/blog\/guide-for-nodejs-as-backend\/\" target=\"_blank\" rel=\"noreferrer noopener\">Node.js<\/a>, callbacks are used heavily for I\/O operations.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const fs = require(\"fs\");\n\nfs.readFile(\"file.txt\", \"utf8\", function (err, data) {\n\n&nbsp;&nbsp;if (err) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;console.log(\"Error reading file\");\n\n&nbsp;&nbsp;&nbsp;&nbsp;return;\n\n&nbsp;&nbsp;}\n\n&nbsp;&nbsp;console.log(data);\n\n});<\/code><\/pre>\n\n\n\n<p>This pattern prevents blocking the server while reading files.<\/p>\n\n\n\n<p>If you want to read more about howJavaScript paves the way for effective coding and its use cases, consider reading HCL GUVI\u2019s Free Ebook: Ultimate<a href=\"https:\/\/www.guvi.in\/mlp\/js-ebook?utm_source=blog&amp;utm_medium=hyperlink&amp;utm_campaign=callback-functions-in-javascript\" target=\"_blank\" rel=\"noreferrer noopener\"> JavaScript Ebook for Beginners<\/a>, which covers the key concepts of JavaScript, including variables, conditional statements, loops, functions, and arrays.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Callback Functions with Parameters<\/strong><\/h2>\n\n\n\n<p>Callbacks can also receive data from the main function.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function calculate(a, b, callback) {\n\n&nbsp;&nbsp;const result = a + b;\n\n&nbsp;&nbsp;callback(result);\n\n}\n\ncalculate(10, 5, function (sum) {\n\n&nbsp;&nbsp;console.log(\"Result is:\", sum);\n\n});<\/code><\/pre>\n\n\n\n<p>This is extremely common when:<\/p>\n\n\n\n<ul>\n<li>Processing data<\/li>\n\n\n\n<li>Handling responses<\/li>\n\n\n\n<li>Chaining logic<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Error Handling with Callbacks<\/strong><\/h2>\n\n\n\n<p>In asynchronous callbacks, errors are often handled using a specific pattern.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>The Error-First Callback Pattern<\/strong><\/h3>\n\n\n\n<p>This is widely used in Node.js.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function getUserData(callback) {\n\n&nbsp;&nbsp;const error = false;\n\n&nbsp;&nbsp;if (error) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;callback(\"Something went wrong\", null);\n\n&nbsp;&nbsp;} else {\n\n&nbsp;&nbsp;&nbsp;&nbsp;callback(null, { name: \"Alex\" });\n\n&nbsp;&nbsp;}\n\n}\n\ngetUserData(function (err, data) {\n\n&nbsp;&nbsp;if (err) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;console.log(err);\n\n&nbsp;&nbsp;&nbsp;&nbsp;return;\n\n&nbsp;&nbsp;}\n\n&nbsp;&nbsp;console.log(data);\n\n});<\/code><\/pre>\n\n\n\n<p><strong>Why This Pattern Exists<\/strong><\/p>\n\n\n\n<ul>\n<li>Consistent error handling<\/li>\n\n\n\n<li>Predictable structure<\/li>\n\n\n\n<li>Easy debugging<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Common Mistakes with Callback Functions<\/strong><\/h2>\n\n\n\n<p>Even experienced developers make these mistakes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Calling the Callback Too Early<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>callback();\n\ndoSomething();<\/code><\/pre>\n\n\n\n<p>This defeats the purpose of a callback.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Forgetting to Call the Callback<\/strong><\/h3>\n\n\n\n<p>This can cause your application to hang, especially in async flows.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Passing the Result Instead of the Function<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Incorrect\n\nsetTimeout(myFunction(), 1000);\n\n\/\/ Correct\n\nsetTimeout(myFunction, 1000);<\/code><\/pre>\n\n\n\n<p>This is a very common beginner mistake.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>When Should You Use Callback Functions?<\/strong><\/h2>\n\n\n\n<p>Callbacks are a good choice when:<\/p>\n\n\n\n<ul>\n<li>The logic is simple<\/li>\n\n\n\n<li>The task is short-lived<\/li>\n\n\n\n<li>You want fine-grained control<\/li>\n\n\n\n<li>You\u2019re working with existing callback-based APIs<\/li>\n<\/ul>\n\n\n\n<p>They may not be ideal when:<\/p>\n\n\n\n<ul>\n<li>The flow becomes deeply nested<\/li>\n\n\n\n<li>Error handling becomes complex<\/li>\n\n\n\n<li>Multiple async operations depend on each other<\/li>\n<\/ul>\n\n\n\n<div style=\"background-color: #099f4e; border: 3px solid #110053; border-radius: 12px; padding: 18px 22px; color: #FFFFFF; font-size: 18px; font-family: Montserrat, Helvetica, sans-serif; line-height: 1.6; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); max-width: 750px;\"><strong style=\"font-size: 22px; color: #FFFFFF;\">\ud83d\udca1 Did You Know?<\/strong> <br \/><br \/>Callbacks are everywhere in JS: behind the scenes, even functions you think of as synchronous can involve callbacks. For instance, many array and DOM methods use callback functions internally. By understanding callbacks now, you\u2019ll have a solid foundation for asynchronous programming in JavaScript.<\/div>\n\n\n\n<p>If you\u2019re serious about mastering JavaScript in full-stack development and want to apply it in real-world scenarios, don\u2019t miss the chance to enroll in HCL GUVI\u2019s IITM Pravartak Certified Online <a href=\"https:\/\/www.guvi.in\/zen-class\/full-stack-development-course\/?utm_source=blog&amp;utm_medium=hyperlink&amp;utm_campaign=callback-functions-in-javascript\" target=\"_blank\" rel=\"noreferrer noopener\">MERN Full Stack Development Course <\/a>with AI Integration. Build full stack skills in MERN with expert guidance, hands-on projects, and career support. Master in-demand tools like Git, MongoDB, Express, React, Node.js, and more!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>Callback functions are one of the most important concepts in JavaScript. They explain how the language handles events, timing, and asynchronous behavior. While modern JavaScript offers cleaner abstractions like promises and async\/await, callbacks remain the foundation beneath them.<\/p>\n\n\n\n<p>If you understand callbacks well, you\u2019re not just learning a syntax pattern. You\u2019re learning how JavaScript thinks.<\/p>\n\n\n\n<p>Once that clicks, everything else becomes easier.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>FAQs<\/strong><\/h2>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1770180023096\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>1. What is a callback function in JavaScript with an example?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>A callback function is a function passed as an argument to another function and executed later. It allows you to control what happens after a task completes. Example: setTimeout(() => console.log(&#8220;Done&#8221;), 1000);<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1770180025184\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>2. Why are callback functions used in JavaScript?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Callbacks are used to handle asynchronous operations like API calls, timers, and events. They prevent the code from blocking while waiting for a task to finish. This keeps JavaScript applications responsive.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1770180029192\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>3. What is the difference between a callback and a promise?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>A callback is a function executed after a task completes. A promise represents a future value and provides cleaner chaining with .then(). Promises help avoid deeply nested callbacks.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1770180033387\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>4. What is callback hell in JavaScript?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Callback hell occurs when callbacks are nested inside multiple callbacks. This makes code hard to read, debug, and maintain. It is commonly solved using promises or async\/await.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1770180037698\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>5. Are callback functions still used in modern JavaScript?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Yes, callbacks are still widely used in events, timers, and array methods. Even promises and async\/await are built on top of callbacks internally. Understanding callbacks is essential for mastering JavaScript.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>If you\u2019ve been learning JavaScript for a while, you\u2019ve probably come across the term callback function. It shows up in array methods, event handlers, timers, and almost every discussion about asynchronous JavaScript. At first, it can feel abstract or even unnecessary. Why pass a function into another function at all? Here\u2019s the thing. Callback functions [&hellip;]<\/p>\n","protected":false},"author":22,"featured_media":103241,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[429,294],"tags":[],"views":"967","authorinfo":{"name":"Lukesh S","url":"https:\/\/www.guvi.in\/blog\/author\/lukesh\/"},"thumbnailURL":"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/02\/What-is-a-Callback-Function-in-JavaScript_1-300x116.webp","jetpack_featured_media_url":"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/02\/What-is-a-Callback-Function-in-JavaScript_1.webp","_links":{"self":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts\/100193"}],"collection":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/comments?post=100193"}],"version-history":[{"count":5,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts\/100193\/revisions"}],"predecessor-version":[{"id":103245,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts\/100193\/revisions\/103245"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/media\/103241"}],"wp:attachment":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/media?parent=100193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/categories?post=100193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/tags?post=100193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}