{"id":543,"date":"2025-05-19T11:04:22","date_gmt":"2025-05-19T11:04:22","guid":{"rendered":"https:\/\/buhave.com\/courses\/?p=543"},"modified":"2025-05-20T12:57:18","modified_gmt":"2025-05-20T12:57:18","slug":"basics-and-syntax","status":"publish","type":"post","link":"https:\/\/buhave.com\/courses\/java-script\/basics-and-syntax\/","title":{"rendered":"Basics and Syntax"},"content":{"rendered":"<h2>Variables (let, const, var)<\/h2>\n<h3>1. What Are Variables?<\/h3>\n<p>Variables store data values that can be used and manipulated in your code.<\/p>\n<p style=\"text-align: center\"><em>let name = &#8220;Alice&#8221;;<\/em><br \/>\n<em>const age = 30;<\/em><br \/>\n<em>var city = &#8220;Paris&#8221;;<\/em><\/p>\n<h3>2. let \u2013 Block-scoped, Reassignable<\/h3>\n<p>Introduced in ES6 (2015), let is the go-to for variables that can change.<\/p>\n<p style=\"text-align: center\"><em>let counter = 1;<\/em><br \/>\n<em>counter = 2; \/\/ reassigning is allowed<\/em><\/p>\n<p><strong>Characteristics:<\/strong><\/p>\n<ul>\n<li>Block-scoped (confined to {}).<\/li>\n<li>Can be updated, but not re-declared in the same scope.<\/li>\n<li>Does not hoist the same way var does (it has a &#8220;temporal dead zone&#8221;).<\/li>\n<\/ul>\n<p style=\"text-align: center\"><em>{<\/em><br \/>\n<em>let x = 10;<\/em><br \/>\n<em>}<\/em><br \/>\n<em>\/\/ console.log(x); ReferenceError: x is not defined<\/em><\/p>\n<h3>3. const \u2013 Block-scoped, Not Reassignable<\/h3>\n<p>Used for constants \u2013 values that shouldn\u2019t change.<\/p>\n<p style=\"text-align: center\"><em>const pi = 3.14;<\/em><br \/>\n<em>\/\/ pi = 3.14159 Error: Assignment to constant variable<\/em><\/p>\n<p><strong>Characteristics:<\/strong><\/p>\n<ul>\n<li>Also block-scoped.<\/li>\n<li>Must be initialized when declared.<\/li>\n<li>You can\u2019t reassign, but if the value is an object or array, its contents can be changed.<\/li>\n<\/ul>\n<p style=\"text-align: center\"><em>const person = { name: &#8220;Alice&#8221; };<\/em><br \/>\n<em>person.name = &#8220;Bob&#8221;; \/\/ allowed<\/em><\/p>\n<h3>4. var \u2013 Function-scoped, Legacy<\/h3>\n<p>Old way (pre-ES6) of declaring variables.<\/p>\n<p style=\"text-align: center\"><em>var color = &#8220;blue&#8221;;<\/em><br \/>\n<em>color = &#8220;red&#8221;; \/\/<\/em><\/p>\n<p><strong>Characteristics:<\/strong><\/p>\n<ul>\n<li>Function-scoped, not block-scoped.<\/li>\n<li>Can be re-declared and updated.<\/li>\n<li>Hoisted to the top of its function \u2014 initialized as undefined.<\/li>\n<\/ul>\n<p style=\"text-align: center\"><em>console.log(a); \/\/ undefined<\/em><br \/>\n<em>var a = 5;<\/em><\/p>\n<h3>5. Comparison Table<\/h3>\n<table>\n<thead>\n<tr>\n<th>Feature<\/th>\n<th>var<\/th>\n<th>let<\/th>\n<th>const<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Scope<\/td>\n<td>Function<\/td>\n<td>Block<\/td>\n<td>Block<\/td>\n<\/tr>\n<tr>\n<td>Hoisting<\/td>\n<td>Yes (initialized to undefined)<\/td>\n<td>Yes (in TDZ)<\/td>\n<td>Yes (in TDZ)<\/td>\n<\/tr>\n<tr>\n<td>Reassignable<\/td>\n<td class=\"check\">yes<\/td>\n<td class=\"check\">yes<\/td>\n<td class=\"cross\">no<\/td>\n<\/tr>\n<tr>\n<td>Redeclarable<\/td>\n<td class=\"check\">yes<\/td>\n<td class=\"cross\">no<\/td>\n<td class=\"cross\">no<\/td>\n<\/tr>\n<tr>\n<td>Use Case<\/td>\n<td>Legacy code<\/td>\n<td>Mutable variables<\/td>\n<td>Immutable bindings<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Best Practices:<\/strong><\/p>\n<ul>\n<li>Use **let** when the value will change.<\/li>\n<li>Use **const** by default \u2014 only switch to let if needed.<\/li>\n<li>Avoid **var** unless working with legacy code.<\/li>\n<\/ul>\n<h2>Data types (Number, String, Boolean, Null, Undefined, Symbol)<\/h2>\n<h3>1. Primitive Data Types in JavaScript<\/h3>\n<p><strong>JavaScript has 7 primitive types (6 main ones + BigInt added in ES2020):<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"type-name\">Number<\/td>\n<td>Numeric values (integer or float)<\/td>\n<\/tr>\n<tr>\n<td class=\"type-name\">String<\/td>\n<td>Text values<\/td>\n<\/tr>\n<tr>\n<td class=\"type-name\">Boolean<\/td>\n<td>true or false<\/td>\n<\/tr>\n<tr>\n<td class=\"type-name\">Null<\/td>\n<td>Intentional absence of value<\/td>\n<\/tr>\n<tr>\n<td class=\"type-name\">Undefined<\/td>\n<td>Declared but not assigned<\/td>\n<\/tr>\n<tr>\n<td class=\"type-name\">Symbol<\/td>\n<td>Unique and immutable identifier (ES6)<\/td>\n<\/tr>\n<tr>\n<td class=\"type-name\">BigInt<\/td>\n<td>For very large integers (optional\/advanced)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>2. Number<\/h3>\n<p>Represents both integers and floating-point numbers.<\/p>\n<p style=\"text-align: center\"><em>let age = 30;<\/em><br \/>\n<em>let price = 19.99;<\/em><\/p>\n<p><strong>Notes:<\/strong><\/p>\n<ul>\n<li>All numbers are 64-bit floating point under the hood.<\/li>\n<\/ul>\n<p><strong>Special values:<\/strong><\/p>\n<ul>\n<li>Infinity, -Infinity, NaN (Not a Number)<\/li>\n<\/ul>\n<p style=\"text-align: center\"><em>console.log(1 \/ 0); \/\/ Infinity<\/em><br \/>\n<em>console.log(&#8220;a&#8221; \/ 2); \/\/ NaN<\/em><\/p>\n<h3>3. String<\/h3>\n<p>Represents text data.<\/p>\n<p style=\"text-align: center\"><em>let name = &#8220;Alice&#8221;;<\/em><br \/>\n<em>let greeting = &#8216;Hello&#8217;;<\/em><br \/>\n<em>let phrase = `Hi, ${name}`;<\/em><\/p>\n<p><strong>Notes:<\/strong><\/p>\n<ul>\n<li>Can be declared with single, double, or backticks.<\/li>\n<li>Backticks (`) allow template literals and interpolation.<\/li>\n<\/ul>\n<p style=\"text-align: center\"><em>let result = `2 + 2 = ${2 + 2}`; \/\/ &#8220;2 + 2 = 4&#8221;<\/em><\/p>\n<h3>4. Boolean<\/h3>\n<p>Represents a true\/false value.<\/p>\n<p style=\"text-align: center\"><em>let isActive = true;<\/em><br \/>\n<em>let isLoggedIn = false;<\/em><\/p>\n<p><strong>Notes:<\/strong><\/p>\n<ul>\n<li>Used in conditionals, logic, and comparisons.<\/li>\n<li>Falsy values include: false, 0, &#8220;&#8221;, null, undefined, NaN<\/li>\n<\/ul>\n<h3>5. Null<\/h3>\n<p>Represents intentional absence of any value.<\/p>\n<p style=\"text-align: center\"><em>let score = null;<\/em><\/p>\n<p><strong>Notes:<\/strong><\/p>\n<ul>\n<li>Often used to reset or clear a variable.<\/li>\n<li>typeof null is &#8220;object&#8221; \u2014 a quirk in JavaScript.<\/li>\n<\/ul>\n<h3>6. Undefined<\/h3>\n<p>A variable that\u2019s declared but not assigned.<\/p>\n<p style=\"text-align: center\"><em>let x;<\/em><br \/>\n<em>console.log(x); \/\/ undefined<\/em><\/p>\n<p><strong>Notes:<\/strong><\/p>\n<ul>\n<li>Also returned by functions that don\u2019t explicitly return anything.<\/li>\n<li>JavaScript uses it to signal &#8220;missing&#8221; or &#8220;uninitialized&#8221;.<\/li>\n<\/ul>\n<h3>7. Symbol (ES6+)<\/h3>\n<p>Represents a unique, immutable identifier.<\/p>\n<p style=\"text-align: center\"><em>let id = Symbol(&#8220;userID&#8221;);<\/em><br \/>\n<em>let id2 = Symbol(&#8220;userID&#8221;);<\/em><br \/>\n<em>console.log(id === id2); \/\/ false<\/em><\/p>\n<p><strong>Use Case:<\/strong><\/p>\n<ul>\n<li>Creating unique property keys in objects to avoid name collisions.<\/li>\n<\/ul>\n<p><strong>Bonus: BigInt (ES2020+)<\/strong><\/p>\n<p style=\"text-align: center\"><em>For working with very large integers beyond Number.MAX_SAFE_INTEGER.<\/em><\/p>\n<p style=\"text-align: center\"><em>let big = 1234567890123456789012345678901234567890n;<\/em><\/p>\n<p><strong>Type Summary Table:<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>Type<\/th>\n<th>Example<\/th>\n<th>typeof result<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"type-name\">Number<\/td>\n<td class=\"example\">42, 3.14<\/td>\n<td class=\"typeof-result\">&#8220;number&#8221;<\/td>\n<\/tr>\n<tr>\n<td class=\"type-name\">String<\/td>\n<td class=\"example\">&#8220;hello&#8221;, &#8216;world&#8217;<\/td>\n<td class=\"typeof-result\">&#8220;string&#8221;<\/td>\n<\/tr>\n<tr>\n<td class=\"type-name\">Boolean<\/td>\n<td class=\"example\">true, false<\/td>\n<td class=\"typeof-result\">&#8220;boolean&#8221;<\/td>\n<\/tr>\n<tr>\n<td class=\"type-name\">Null<\/td>\n<td class=\"example\">null<\/td>\n<td class=\"typeof-result\">&#8220;object&#8221; <span class=\"note\">(historical quirk)<\/span><\/td>\n<\/tr>\n<tr>\n<td class=\"type-name\">Undefined<\/td>\n<td class=\"example\">undefined<\/td>\n<td class=\"typeof-result\">&#8220;undefined&#8221;<\/td>\n<\/tr>\n<tr>\n<td class=\"type-name\">Symbol<\/td>\n<td class=\"example\">Symbol(&#8220;id&#8221;)<\/td>\n<td class=\"typeof-result\">&#8220;symbol&#8221;<\/td>\n<\/tr>\n<tr>\n<td class=\"type-name\">BigInt<\/td>\n<td class=\"example\">123n<\/td>\n<td class=\"typeof-result\">&#8220;bigint&#8221;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Operators: arithmetic, comparison, logical<\/h2>\n<h3>1. Arithmetic Operators<\/h3>\n<p>Used to perform mathematical calculations.<\/p>\n<table>\n<thead>\n<tr>\n<th>Operator<\/th>\n<th>Description<\/th>\n<th>Example<\/th>\n<th>Result<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"operator\">+<\/td>\n<td>Addition<\/td>\n<td class=\"example\">5 + 2<\/td>\n<td class=\"result\">7<\/td>\n<\/tr>\n<tr>\n<td class=\"operator\">&#8211;<\/td>\n<td>Subtraction<\/td>\n<td class=\"example\">5 &#8211; 2<\/td>\n<td class=\"result\">3<\/td>\n<\/tr>\n<tr>\n<td class=\"operator\">*<\/td>\n<td>Multiplication<\/td>\n<td class=\"example\">5 * 2<\/td>\n<td class=\"result\">10<\/td>\n<\/tr>\n<tr>\n<td class=\"operator\">\/<\/td>\n<td>Division<\/td>\n<td class=\"example\">5 \/ 2<\/td>\n<td class=\"result\">2.5<\/td>\n<\/tr>\n<tr>\n<td class=\"operator\">%<\/td>\n<td>Modulus (Remainder)<\/td>\n<td class=\"example\">5 % 2<\/td>\n<td class=\"result\">1<\/td>\n<\/tr>\n<tr>\n<td class=\"operator\">**<\/td>\n<td>Exponentiation<\/td>\n<td class=\"example\">5 ** 2<\/td>\n<td class=\"result\">25<\/td>\n<\/tr>\n<tr>\n<td class=\"operator\">++<\/td>\n<td>Increment<\/td>\n<td class=\"example\">let x = 1; x++<\/td>\n<td class=\"result\">2 <span class=\"note\">(x becomes 2)<\/span><\/td>\n<\/tr>\n<tr>\n<td class=\"operator\">&#8212;<\/td>\n<td>Decrement<\/td>\n<td class=\"example\">let x = 2; x&#8211;<\/td>\n<td class=\"result\">1 <span class=\"note\">(x becomes 1)<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Notes:<\/strong><\/p>\n<ul>\n<li>++ and &#8212; have prefix and postfix forms.<\/li>\n<\/ul>\n<p style=\"text-align: center\"><em>let a = 5;<\/em><br \/>\n<em>console.log(++a); \/\/ 6 (prefix: increment, then use)<\/em><br \/>\n<em>console.log(a++); \/\/ 6 (postfix: use, then increment)<\/em><\/p>\n<h3>2. Comparison Operators<\/h3>\n<p>Used to compare values; result is always true or false.<\/p>\n<table>\n<thead>\n<tr>\n<th>Operator<\/th>\n<th>Description<\/th>\n<th>Example<\/th>\n<th>Result<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"operator\">==<\/td>\n<td>Equal to (loose)<\/td>\n<td class=\"example\">5 == &#8220;5&#8221;<\/td>\n<td class=\"result-true\">true<\/td>\n<\/tr>\n<tr>\n<td class=\"operator\">===<\/td>\n<td>Equal to (strict)<\/td>\n<td class=\"example\">5 === &#8220;5&#8221;<\/td>\n<td class=\"result-false\">false<\/td>\n<\/tr>\n<tr>\n<td class=\"operator\">!=<\/td>\n<td>Not equal (loose)<\/td>\n<td class=\"example\">5 != &#8220;5&#8221;<\/td>\n<td class=\"result-false\">false<\/td>\n<\/tr>\n<tr>\n<td class=\"operator\">!==<\/td>\n<td>Not equal (strict)<\/td>\n<td class=\"example\">5 !== &#8220;5&#8221;<\/td>\n<td class=\"result-true\">true<\/td>\n<\/tr>\n<tr>\n<td class=\"operator\">&gt;<\/td>\n<td>Greater than<\/td>\n<td class=\"example\">5 &gt; 2<\/td>\n<td class=\"result-true\">true<\/td>\n<\/tr>\n<tr>\n<td class=\"operator\">&lt;<\/td>\n<td>Less than<\/td>\n<td class=\"example\">5 &lt; 2<\/td>\n<td class=\"result-false\">false<\/td>\n<\/tr>\n<tr>\n<td class=\"operator\">&gt;=<\/td>\n<td>Greater than or equal to<\/td>\n<td class=\"example\">5 &gt;= 5<\/td>\n<td class=\"result-true\">true<\/td>\n<\/tr>\n<tr>\n<td class=\"operator\">&lt;=<\/td>\n<td>Less than or equal to<\/td>\n<td class=\"example\">5 &lt;= 4<\/td>\n<td class=\"result-false\">false<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Notes:<\/strong><\/p>\n<p>=== and !== are preferred to avoid type coercion issues.<\/p>\n<p style=\"text-align: center\"><em>0 == false \/\/ true<\/em><br \/>\n<em>0 === false \/\/ false<\/em><\/p>\n<h3>3. Logical Operators<\/h3>\n<p>Used for combining boolean expressions.<\/p>\n<table>\n<thead>\n<tr>\n<th>Operator<\/th>\n<th>Name<\/th>\n<th>Example<\/th>\n<th>Result<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"operator\">&amp;&amp;<\/td>\n<td>AND<\/td>\n<td class=\"example\">true &amp;&amp; false<\/td>\n<td class=\"result-false\">false<\/td>\n<\/tr>\n<tr>\n<td class=\"operator\">||<\/td>\n<td>OR<\/td>\n<td class=\"example\">true || false<\/td>\n<td class=\"result-true\">true<\/td>\n<\/tr>\n<tr>\n<td class=\"operator\">!<\/td>\n<td>NOT<\/td>\n<td class=\"example\">!true<\/td>\n<td class=\"result-false\">false<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Truth Table for &amp;&amp; and ||:<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>A<\/th>\n<th>B<\/th>\n<th class=\"operator\">A &amp;&amp; B (AND)<\/th>\n<th class=\"operator\">A || B (OR)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"result-true\">true<\/td>\n<td class=\"result-true\">true<\/td>\n<td class=\"result-true\">true<\/td>\n<td class=\"result-true\">true<\/td>\n<\/tr>\n<tr>\n<td class=\"result-true\">true<\/td>\n<td class=\"result-false\">false<\/td>\n<td class=\"result-false\">false<\/td>\n<td class=\"result-true\">true<\/td>\n<\/tr>\n<tr>\n<td class=\"result-false\">false<\/td>\n<td class=\"result-true\">true<\/td>\n<td class=\"result-false\">false<\/td>\n<td class=\"result-true\">true<\/td>\n<\/tr>\n<tr>\n<td class=\"result-false\">false<\/td>\n<td class=\"result-false\">false<\/td>\n<td class=\"result-false\">false<\/td>\n<td class=\"result-false\">false<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"note\"><strong>Notes:<\/strong><\/p>\n<p class=\"note\">Logical operators return the last evaluated value, not just true or false.<\/p>\n<p style=\"text-align: center\"><em>let name = &#8220;&#8221;;<\/em><br \/>\n<em>let username = name || &#8220;Guest&#8221;; \/\/ &#8220;Guest&#8221; because &#8220;&#8221; is falsy<\/em><\/p>\n<p style=\"text-align: center\"><em>let isLoggedIn = true;<\/em><br \/>\n<em>isLoggedIn &amp;&amp; console.log(&#8220;Welcome!&#8221;); \/\/ Logs only if true<\/em><\/p>\n<p><strong>Bonus:<\/strong> Combined Example<\/p>\n<p style=\"text-align: center\"><em>let age = 20;<\/em><\/p>\n<p style=\"text-align: center\"><em>if (age &gt;= 18 &amp;&amp; age &lt; 65) {<\/em><br \/>\n<em>console.log(&#8220;Adult&#8221;);<\/em><br \/>\n<em>} else if (age &gt;= 65) {<\/em><br \/>\n<em>console.log(&#8220;Senior&#8221;);<\/em><br \/>\n<em>} else {<\/em><br \/>\n<em>console.log(&#8220;Minor&#8221;);<\/em><br \/>\n<em>}<\/em><\/p>\n<h2>String concatenation and template literals<\/h2>\n<h3>1. String Concatenation (Using + or +=)<\/h3>\n<p>This is the classic way of combining strings.<\/p>\n<p style=\"text-align: center\"><em>let firstName = &#8220;John&#8221;;<\/em><br \/>\n<em>let lastName = &#8220;Doe&#8221;;<\/em><br \/>\n<em>let fullName = firstName + &#8221; &#8221; + lastName;<\/em><br \/>\n<em>console.log(fullName); \/\/ &#8220;John Doe&#8221;<\/em><\/p>\n<p><strong>Concatenating Multiple Strings:<\/strong><\/p>\n<p style=\"text-align: center\"><em>let msg = &#8220;Hello, &#8221; + firstName + &#8220;! You have &#8221; + 3 + &#8221; new messages.&#8221;;<\/em><\/p>\n<ul>\n<li>Numbers are converted to strings automatically.<\/li>\n<li>Can get messy with many variables or dynamic content.<\/li>\n<\/ul>\n<p><strong>+= Operator:<\/strong><\/p>\n<p><strong>Used to append to a string:<\/strong><\/p>\n<p style=\"text-align: center\"><em>let str = &#8220;Hello&#8221;;<\/em><br \/>\n<em>str += &#8221; world&#8221;;<\/em><br \/>\n<em>console.log(str); \/\/ &#8220;Hello world&#8221;<\/em><\/p>\n<h3>2. Template Literals (ES6 Feature)<\/h3>\n<p>A modern, cleaner way to build strings using backticks ( ` ).<\/p>\n<p style=\"text-align: center\"><em>let name = &#8220;Alice&#8221;;<\/em><br \/>\n<em>let greeting = `Hello, ${name}!`;<\/em><br \/>\n<em>console.log(greeting); \/\/ &#8220;Hello, Alice!&#8221;<\/em><\/p>\n<p><strong>Benefits:<\/strong><\/p>\n<ul>\n<li>Easier to insert variables.<\/li>\n<li>Supports multiline strings.<\/li>\n<li>More readable for dynamic content.<\/li>\n<\/ul>\n<h3>3. Using Expressions Inside Template Literals<\/h3>\n<p style=\"text-align: center\"><em>let a = 10, b = 5;<\/em><br \/>\n<em>let result = `Sum of ${a} and ${b} is ${a + b}`;<\/em><br \/>\n<em>console.log(result); \/\/ &#8220;Sum of 10 and 5 is 15&#8221;<\/em><\/p>\n<h3>4. Multiline Strings<\/h3>\n<p><strong>With concatenation (old way):<\/strong><\/p>\n<p style=\"text-align: center\"><em>let poem = &#8220;Roses are red,\\n&#8221; + <\/em><br \/>\n<em>&#8220;Violets are blue.&#8221;;<\/em><\/p>\n<p><strong>With template literals:<\/strong><\/p>\n<p style=\"text-align: center\"><em>let poem = `Roses are red,<\/em><br \/>\n<em>Violets are blue.`;<\/em><\/p>\n<p>Bonus: Preserves tabs and line breaks automatically.<\/p>\n<h3>5. Example Comparison<\/h3>\n<p><strong>Concatenation:<\/strong><\/p>\n<p style=\"text-align: center\"><em>let user = &#8220;Jack&#8221;;<\/em><br \/>\n<em>let age = 25;<\/em><br \/>\n<em>let message = &#8220;User &#8221; + user + &#8221; is &#8221; + age + &#8221; years old.&#8221;;<\/em><\/p>\n<p><strong>Template Literal:<\/strong><\/p>\n<p style=\"text-align: center\"><em>let message = `User ${user} is ${age} years old.`;<\/em><\/p>\n<p><strong>When to Use What?<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>Use Case<\/th>\n<th>Recommended Approach<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Static text only<\/td>\n<td><span class=\"code\">Concatenation<\/span> or <span class=\"code\">string literals<\/span><\/p>\n<div class=\"note\">Example: &#8216;Hello &#8216; + &#8216;World&#8217; or &#8216;Hello World&#8217;<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>Dynamic + readable strings<\/td>\n<td class=\"recommended\">Template literals<\/td>\n<\/tr>\n<tr>\n<td>Multiline strings<\/td>\n<td class=\"recommended\">Template literals<\/td>\n<\/tr>\n<tr>\n<td>HTML templates<\/td>\n<td class=\"recommended\">Template literals<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Comments and code structure<\/h2>\n<h3>1. Comments in JavaScript<\/h3>\n<p><strong>Single-line Comments<\/strong><\/p>\n<p>Use \/\/ to write comments on a single line.<\/p>\n<p style=\"text-align: center\"><em>\/\/ This is a single-line comment<\/em><br \/>\n<em>let name = &#8220;Alice&#8221;; \/\/ This is also a valid comment<\/em><\/p>\n<p><strong>Multi-line (Block) Comments<\/strong><\/p>\n<p>Use \/* *\/ for comments that span multiple lines.<\/p>\n<p style=\"text-align: center\"><em>\/*<\/em><br \/>\n<em>This is a multi-line comment.<\/em><br \/>\n<em>Useful for longer explanations.<\/em><br \/>\n<em>*\/<\/em><br \/>\n<em>let age = 25;<\/em><\/p>\n<p><strong>Use Comments To:<\/strong><\/p>\n<ul>\n<li>Explain why, not just what.<\/li>\n<li>Document tricky logic.<\/li>\n<li>Temporarily disable code (comment it out).<\/li>\n<li>Label sections of code.<\/li>\n<\/ul>\n<h3>2. Code Structure Basics<\/h3>\n<p><strong>1. Declare Variables at the Top<\/strong><\/p>\n<p>Keeps data organized and easy to find.<\/p>\n<p style=\"text-align: center\"><em>let userName = &#8220;Jane&#8221;;<\/em><br \/>\n<em>const maxAttempts = 3;<\/em><\/p>\n<p><strong>2. Use Functions to Organize Logic<\/strong><\/p>\n<p>Break your code into reusable blocks.<\/p>\n<p style=\"text-align: center\"><em>function greetUser(name) {<\/em><br \/>\n<em>return `Hello, ${name}!`;<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>3. Group Related Code<\/strong><\/p>\n<p>Use spacing and comments to group by purpose.<\/p>\n<p style=\"text-align: center\"><em>\/\/ &#8212; User Input &#8212;<\/em><br \/>\n<em>let name = prompt(&#8220;Enter your name:&#8221;);<\/em><\/p>\n<p style=\"text-align: center\"><em>\/\/ &#8212; Processing &#8212;<\/em><br \/>\n<em>let greeting = `Hello, ${name}`;<\/em><\/p>\n<p style=\"text-align: center\"><em>\/\/ &#8212; Output &#8212;<\/em><br \/>\n<em>alert(greeting);<\/em><\/p>\n<h3>3. Indentation &amp; Formatting<\/h3>\n<p><strong>Consistent Indentation:<\/strong><\/p>\n<ul>\n<li>Use 2 or 4 spaces, not tabs.<\/li>\n<li>Nested blocks should be indented clearly.<\/li>\n<\/ul>\n<p style=\"text-align: center\"><em>if (isActive) {<\/em><br \/>\n<em>console.log(&#8220;Active&#8221;);<\/em><br \/>\n<em>} else {<\/em><br \/>\n<em>console.log(&#8220;Inactive&#8221;);<\/em><br \/>\n<em>}<\/em><\/p>\n<p><strong>Line Breaks &amp; Spacing:<\/strong><\/p>\n<ul>\n<li>Add blank lines between logical sections.<\/li>\n<li>Keep lines under 80\u2013100 characters when possible.<\/li>\n<\/ul>\n<h3>4. Naming Conventions<\/h3>\n<table>\n<thead>\n<tr>\n<th>Item<\/th>\n<th>Convention<\/th>\n<th>Example<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Variable<\/td>\n<td class=\"convention\">camelCase<\/td>\n<td class=\"example\">userName<\/td>\n<\/tr>\n<tr>\n<td>Constant<\/td>\n<td class=\"convention\">UPPER_SNAKE_CASE<\/td>\n<td class=\"example\">MAX_USERS<\/td>\n<\/tr>\n<tr>\n<td>Function<\/td>\n<td class=\"convention\">camelCase<\/td>\n<td class=\"example\">getUserInfo()<\/td>\n<\/tr>\n<tr>\n<td>Class<\/td>\n<td class=\"convention\">PascalCase<\/td>\n<td class=\"example\">UserProfile<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>5. Code Example with Comments &amp; Structure<\/h3>\n<p style=\"text-align: center\"><em>\/\/ App configuration<\/em><br \/>\n<em>const MAX_SCORE = 100;<\/em><\/p>\n<p style=\"text-align: center\"><em>\/\/ &#8212; Input &#8212;<\/em><br \/>\n<em>let userName = prompt(&#8220;Enter your name:&#8221;);<\/em><br \/>\n<em>let score = parseInt(prompt(&#8220;Enter your score:&#8221;));<\/em><\/p>\n<p style=\"text-align: center\"><em>\/\/ &#8212; Logic &#8212;<\/em><br \/>\n<em>function evaluateScore(score) {<\/em><br \/>\n<em>if (score &gt;= 90) {<\/em><br \/>\n<em>return &#8220;Excellent&#8221;;<\/em><br \/>\n<em>} else if (score &gt;= 75) {<\/em><br \/>\n<em>return &#8220;Good&#8221;;<\/em><br \/>\n<em>} else {<\/em><br \/>\n<em>return &#8220;Needs improvement&#8221;;<\/em><br \/>\n<em>}<\/em><br \/>\n<em>}<\/em><\/p>\n<p style=\"text-align: center\"><em>\/\/ &#8212; Output &#8212;<\/em><br \/>\n<em>let message = `${userName}, your result is: ${evaluateScore(score)}`;<\/em><br \/>\n<em>alert(message);<\/em><\/p>\n<p><strong>Summary:<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>Best Practice<\/th>\n<th>Tip<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"best-practice\">Use comments<\/td>\n<td class=\"tip\">To explain &#8220;why&#8221;, not &#8220;what&#8221;<br \/>\n<span class=\"note\">Good: \/\/ Validate email format for security<br \/>\nBad: \/\/ Checking email format<\/span><\/td>\n<\/tr>\n<tr>\n<td class=\"best-practice\">Group related logic<\/td>\n<td class=\"tip\">Using whitespace and headers<br \/>\n<span class=\"note\">Separate different functionality with blank lines<\/span><\/td>\n<\/tr>\n<tr>\n<td class=\"best-practice\">Keep it readable<\/td>\n<td class=\"tip\">Use consistent indentation<br \/>\n<span class=\"note\">Choose either tabs or spaces (2\/4 spaces recommended)<\/span><\/td>\n<\/tr>\n<tr>\n<td class=\"best-practice\">Break into functions<\/td>\n<td class=\"tip\">Avoid long procedural blocks<br \/>\n<span class=\"note\">Functions should do one thing and do it well<\/span><\/td>\n<\/tr>\n<tr>\n<td class=\"best-practice\">Name things clearly<\/td>\n<td class=\"tip\">Avoid single-letter variables<br \/>\n<span class=\"note\">Prefer <span class=\"tip-code\">userCount<\/span> over <span class=\"tip-code\">c<\/span><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Want help applying this to a small project or code refactor?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Variables (let, const, var) 1. What Are Variables? Variables store data values that can be used and manipulated in your code. let name = &#8220;Alice&#8221;; const age = 30; var city = &#8220;Paris&#8221;; 2. let \u2013 Block-scoped, Reassignable Introduced in ES6 (2015), let is the<\/p>\n","protected":false},"author":1,"featured_media":544,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-543","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java-script"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Basics and Syntax - Java Script Course<\/title>\n<meta name=\"description\" content=\"JavaScript basics and syntax provide the foundational rules and structure for writing and organizing code to create dynamic web behavior.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/buhave.com\/courses\/java-script\/basics-and-syntax\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Basics and Syntax - Java Script Course\" \/>\n<meta property=\"og:description\" content=\"JavaScript basics and syntax provide the foundational rules and structure for writing and organizing code to create dynamic web behavior.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/buhave.com\/courses\/java-script\/basics-and-syntax\/\" \/>\n<meta property=\"og:site_name\" content=\"BUHAVE\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/BeYouHave\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/naveedsafdarawan\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-19T11:04:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-20T12:57:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/04\/Basics-and-Syntax.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Naveed Safdar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Naveed Safdar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/java-script\\\/basics-and-syntax\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/java-script\\\/basics-and-syntax\\\/\"},\"author\":{\"name\":\"Naveed Safdar\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/person\\\/04fe0254e118521c9fbb3da39de5acca\"},\"headline\":\"Basics and Syntax\",\"datePublished\":\"2025-05-19T11:04:22+00:00\",\"dateModified\":\"2025-05-20T12:57:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/java-script\\\/basics-and-syntax\\\/\"},\"wordCount\":1374,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/java-script\\\/basics-and-syntax\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/Basics-and-Syntax.webp\",\"articleSection\":[\"Java Script Course\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/buhave.com\\\/courses\\\/java-script\\\/basics-and-syntax\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/java-script\\\/basics-and-syntax\\\/\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/java-script\\\/basics-and-syntax\\\/\",\"name\":\"Basics and Syntax - Java Script Course\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/java-script\\\/basics-and-syntax\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/java-script\\\/basics-and-syntax\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/Basics-and-Syntax.webp\",\"datePublished\":\"2025-05-19T11:04:22+00:00\",\"dateModified\":\"2025-05-20T12:57:18+00:00\",\"description\":\"JavaScript basics and syntax provide the foundational rules and structure for writing and organizing code to create dynamic web behavior.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/java-script\\\/basics-and-syntax\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/buhave.com\\\/courses\\\/java-script\\\/basics-and-syntax\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/java-script\\\/basics-and-syntax\\\/#primaryimage\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/Basics-and-Syntax.webp\",\"contentUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/Basics-and-Syntax.webp\",\"width\":1200,\"height\":628,\"caption\":\"Basics and Syntax\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/java-script\\\/basics-and-syntax\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Courses\",\"item\":\"https:\\\/\\\/buhave.com\\\/courses\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java Script Course\",\"item\":\"https:\\\/\\\/buhave.com\\\/courses\\\/learn\\\/java-script\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Basics and Syntax\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#website\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/\",\"name\":\"BUHAVE\",\"description\":\"Courses - Learn Online for Free\",\"publisher\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/buhave.com\\\/courses\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#organization\",\"name\":\"BUHAVE\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/buhave-course.webp\",\"contentUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/buhave-course.webp\",\"width\":375,\"height\":75,\"caption\":\"BUHAVE\"},\"image\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/BeYouHave\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/buhave\",\"https:\\\/\\\/www.youtube.com\\\/@buhave\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/person\\\/04fe0254e118521c9fbb3da39de5acca\",\"name\":\"Naveed Safdar\",\"description\":\"I\u2019m Naveed Safdar - SEO Manager with over 10 years of experience in SEO and Digital Marketing. I\u2019ve had the privilege of working with leading national and international companies including Grafdom, PakWheels, Systems Limited, Confiz, Educative, and Dubizzle Labs. My expertise spans technical SEO, content strategy, organic growth, and performance analytics - helping businesses improve visibility, traffic, and ROI.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/naveedsafdar\\\/\",\"https:\\\/\\\/www.facebook.com\\\/naveedsafdarawan\\\/\",\"https:\\\/\\\/www.youtube.com\\\/@naveedsafdar\"],\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/author\\\/naveed-safdar\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Basics and Syntax - Java Script Course","description":"JavaScript basics and syntax provide the foundational rules and structure for writing and organizing code to create dynamic web behavior.","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:\/\/buhave.com\/courses\/java-script\/basics-and-syntax\/","og_locale":"en_US","og_type":"article","og_title":"Basics and Syntax - Java Script Course","og_description":"JavaScript basics and syntax provide the foundational rules and structure for writing and organizing code to create dynamic web behavior.","og_url":"https:\/\/buhave.com\/courses\/java-script\/basics-and-syntax\/","og_site_name":"BUHAVE","article_publisher":"https:\/\/www.facebook.com\/BeYouHave\/","article_author":"https:\/\/www.facebook.com\/naveedsafdarawan\/","article_published_time":"2025-05-19T11:04:22+00:00","article_modified_time":"2025-05-20T12:57:18+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/04\/Basics-and-Syntax.webp","type":"image\/webp"}],"author":"Naveed Safdar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Naveed Safdar","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/buhave.com\/courses\/java-script\/basics-and-syntax\/#article","isPartOf":{"@id":"https:\/\/buhave.com\/courses\/java-script\/basics-and-syntax\/"},"author":{"name":"Naveed Safdar","@id":"https:\/\/buhave.com\/courses\/#\/schema\/person\/04fe0254e118521c9fbb3da39de5acca"},"headline":"Basics and Syntax","datePublished":"2025-05-19T11:04:22+00:00","dateModified":"2025-05-20T12:57:18+00:00","mainEntityOfPage":{"@id":"https:\/\/buhave.com\/courses\/java-script\/basics-and-syntax\/"},"wordCount":1374,"commentCount":0,"publisher":{"@id":"https:\/\/buhave.com\/courses\/#organization"},"image":{"@id":"https:\/\/buhave.com\/courses\/java-script\/basics-and-syntax\/#primaryimage"},"thumbnailUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/04\/Basics-and-Syntax.webp","articleSection":["Java Script Course"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/buhave.com\/courses\/java-script\/basics-and-syntax\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/buhave.com\/courses\/java-script\/basics-and-syntax\/","url":"https:\/\/buhave.com\/courses\/java-script\/basics-and-syntax\/","name":"Basics and Syntax - Java Script Course","isPartOf":{"@id":"https:\/\/buhave.com\/courses\/#website"},"primaryImageOfPage":{"@id":"https:\/\/buhave.com\/courses\/java-script\/basics-and-syntax\/#primaryimage"},"image":{"@id":"https:\/\/buhave.com\/courses\/java-script\/basics-and-syntax\/#primaryimage"},"thumbnailUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/04\/Basics-and-Syntax.webp","datePublished":"2025-05-19T11:04:22+00:00","dateModified":"2025-05-20T12:57:18+00:00","description":"JavaScript basics and syntax provide the foundational rules and structure for writing and organizing code to create dynamic web behavior.","breadcrumb":{"@id":"https:\/\/buhave.com\/courses\/java-script\/basics-and-syntax\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/buhave.com\/courses\/java-script\/basics-and-syntax\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/buhave.com\/courses\/java-script\/basics-and-syntax\/#primaryimage","url":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/04\/Basics-and-Syntax.webp","contentUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/04\/Basics-and-Syntax.webp","width":1200,"height":628,"caption":"Basics and Syntax"},{"@type":"BreadcrumbList","@id":"https:\/\/buhave.com\/courses\/java-script\/basics-and-syntax\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Courses","item":"https:\/\/buhave.com\/courses\/"},{"@type":"ListItem","position":2,"name":"Java Script Course","item":"https:\/\/buhave.com\/courses\/learn\/java-script\/"},{"@type":"ListItem","position":3,"name":"Basics and Syntax"}]},{"@type":"WebSite","@id":"https:\/\/buhave.com\/courses\/#website","url":"https:\/\/buhave.com\/courses\/","name":"BUHAVE","description":"Courses - Learn Online for Free","publisher":{"@id":"https:\/\/buhave.com\/courses\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/buhave.com\/courses\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/buhave.com\/courses\/#organization","name":"BUHAVE","url":"https:\/\/buhave.com\/courses\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/buhave.com\/courses\/#\/schema\/logo\/image\/","url":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/03\/buhave-course.webp","contentUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/03\/buhave-course.webp","width":375,"height":75,"caption":"BUHAVE"},"image":{"@id":"https:\/\/buhave.com\/courses\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/BeYouHave\/","https:\/\/www.linkedin.com\/company\/buhave","https:\/\/www.youtube.com\/@buhave"]},{"@type":"Person","@id":"https:\/\/buhave.com\/courses\/#\/schema\/person\/04fe0254e118521c9fbb3da39de5acca","name":"Naveed Safdar","description":"I\u2019m Naveed Safdar - SEO Manager with over 10 years of experience in SEO and Digital Marketing. I\u2019ve had the privilege of working with leading national and international companies including Grafdom, PakWheels, Systems Limited, Confiz, Educative, and Dubizzle Labs. My expertise spans technical SEO, content strategy, organic growth, and performance analytics - helping businesses improve visibility, traffic, and ROI.","sameAs":["https:\/\/www.linkedin.com\/in\/naveedsafdar\/","https:\/\/www.facebook.com\/naveedsafdarawan\/","https:\/\/www.youtube.com\/@naveedsafdar"],"url":"https:\/\/buhave.com\/courses\/author\/naveed-safdar\/"}]}},"_links":{"self":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts\/543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/comments?post=543"}],"version-history":[{"count":1,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts\/543\/revisions"}],"predecessor-version":[{"id":545,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts\/543\/revisions\/545"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/media\/544"}],"wp:attachment":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/media?parent=543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/categories?post=543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/tags?post=543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}