{"id":77,"date":"2026-05-01T15:05:38","date_gmt":"2026-05-01T15:05:38","guid":{"rendered":"https:\/\/gigz.pk\/javascript\/?post_type=lesson&#038;p=77"},"modified":"2026-05-01T15:05:39","modified_gmt":"2026-05-01T15:05:39","slug":"arithmetic-operators","status":"publish","type":"lesson","link":"https:\/\/gigz.pk\/javascript\/?lesson=arithmetic-operators","title":{"rendered":"Arithmetic Operators"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Introduction<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Arithmetic operators are used in JavaScript to perform basic mathematical calculations. They are essential for handling numbers, building formulas, and creating dynamic logic in web applications.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Understanding arithmetic operators is one of the first steps in learning programming because they are used in almost every type of application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Core Arithmetic Operators<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Addition<br>The addition operator is used to add two values together.<br>Example<br>let result = 5 + 3<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Subtraction<br>The subtraction operator is used to subtract one value from another.<br>Example<br>let result = 10 &#8211; 4<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Multiplication<br>The multiplication operator is used to multiply two values.<br>Example<br>let result = 6 * 2<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Division<br>The division operator is used to divide one value by another.<br>Example<br>let result = 12 \/ 3<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Modulus<br>The modulus operator returns the remainder after division.<br>Example<br>let result = 10 % 3<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Increment<br>The increment operator increases a value by one.<br>Example<br>let x = 5<br>x++<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Decrement<br>The decrement operator decreases a value by one.<br>Example<br>let x = 5<br>x&#8211;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Practical Usage<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Arithmetic operators are commonly used in calculations such as totals, averages, counters, and dynamic data updates. For example, they can be used in shopping carts to calculate total prices or in forms to compute user input values.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Best Practices<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use clear variable names when performing calculations<br>Always check for division by zero to avoid errors<br>Combine operators carefully to maintain readability<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Conclusion<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Arithmetic operators form the foundation of mathematical operations in JavaScript. Mastering them allows you to build efficient and logical programs for real world applications.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n<div class=\"yoast-breadcrumbs\"><span><span><a href=\"https:\/\/gigz.pk\/javascript\">Home<\/a><\/span> \u00bb <span class=\"breadcrumb_last\" aria-current=\"page\">JavaScript Fundamentals (Beginner Level) > Operators and Conditions > Arithmetic Operators<\/span><\/span><\/div>\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1777647875685\"><strong class=\"schema-faq-question\"><\/strong> <p class=\"schema-faq-answer\"><\/p> <\/div> <\/div>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1777647875456\"><strong class=\"schema-faq-question\"><\/strong> <p class=\"schema-faq-answer\"><\/p> <\/div> <\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"menu_order":0,"template":"","class_list":["post-77","lesson","type-lesson","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Arithmetic Operators - Learn JavaScript with GIGZ.PK<\/title>\n<meta name=\"description\" content=\"Learn JavaScript arithmetic operators with examples including addition subtraction multiplication and more for beginners\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gigz.pk\/javascript\/?lesson=arithmetic-operators\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Arithmetic Operators - Learn JavaScript with GIGZ.PK\" \/>\n<meta property=\"og:description\" content=\"Learn JavaScript arithmetic operators with examples including addition subtraction multiplication and more for beginners\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gigz.pk\/javascript\/?lesson=arithmetic-operators\" \/>\n<meta property=\"og:site_name\" content=\"Learn JavaScript with GIGZ.PK\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-01T15:05:39+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/gigz.pk\\\/javascript\\\/?lesson=arithmetic-operators\",\"url\":\"https:\\\/\\\/gigz.pk\\\/javascript\\\/?lesson=arithmetic-operators\",\"name\":\"Arithmetic Operators - Learn JavaScript with GIGZ.PK\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/javascript\\\/#website\"},\"datePublished\":\"2026-05-01T15:05:38+00:00\",\"dateModified\":\"2026-05-01T15:05:39+00:00\",\"description\":\"Learn JavaScript arithmetic operators with examples including addition subtraction multiplication and more for beginners\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/javascript\\\/?lesson=arithmetic-operators#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gigz.pk\\\/javascript\\\/?lesson=arithmetic-operators\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/javascript\\\/?lesson=arithmetic-operators#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gigz.pk\\\/javascript\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript Fundamentals (Beginner Level) > Operators and Conditions > Arithmetic Operators\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/javascript\\\/#website\",\"url\":\"https:\\\/\\\/gigz.pk\\\/javascript\\\/\",\"name\":\"Learn JavaScript with GIGZ.PK\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gigz.pk\\\/javascript\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Arithmetic Operators - Learn JavaScript with GIGZ.PK","description":"Learn JavaScript arithmetic operators with examples including addition subtraction multiplication and more for beginners","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gigz.pk\/javascript\/?lesson=arithmetic-operators","og_locale":"en_US","og_type":"article","og_title":"Arithmetic Operators - Learn JavaScript with GIGZ.PK","og_description":"Learn JavaScript arithmetic operators with examples including addition subtraction multiplication and more for beginners","og_url":"https:\/\/gigz.pk\/javascript\/?lesson=arithmetic-operators","og_site_name":"Learn JavaScript with GIGZ.PK","article_modified_time":"2026-05-01T15:05:39+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["WebPage","FAQPage"],"@id":"https:\/\/gigz.pk\/javascript\/?lesson=arithmetic-operators","url":"https:\/\/gigz.pk\/javascript\/?lesson=arithmetic-operators","name":"Arithmetic Operators - Learn JavaScript with GIGZ.PK","isPartOf":{"@id":"https:\/\/gigz.pk\/javascript\/#website"},"datePublished":"2026-05-01T15:05:38+00:00","dateModified":"2026-05-01T15:05:39+00:00","description":"Learn JavaScript arithmetic operators with examples including addition subtraction multiplication and more for beginners","breadcrumb":{"@id":"https:\/\/gigz.pk\/javascript\/?lesson=arithmetic-operators#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gigz.pk\/javascript\/?lesson=arithmetic-operators"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/gigz.pk\/javascript\/?lesson=arithmetic-operators#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gigz.pk\/javascript"},{"@type":"ListItem","position":2,"name":"JavaScript Fundamentals (Beginner Level) > Operators and Conditions > Arithmetic Operators"}]},{"@type":"WebSite","@id":"https:\/\/gigz.pk\/javascript\/#website","url":"https:\/\/gigz.pk\/javascript\/","name":"Learn JavaScript with GIGZ.PK","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gigz.pk\/javascript\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/gigz.pk\/javascript\/index.php?rest_route=\/wp\/v2\/lesson\/77","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gigz.pk\/javascript\/index.php?rest_route=\/wp\/v2\/lesson"}],"about":[{"href":"https:\/\/gigz.pk\/javascript\/index.php?rest_route=\/wp\/v2\/types\/lesson"}],"wp:attachment":[{"href":"https:\/\/gigz.pk\/javascript\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=77"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}