<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://medjava.ro/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://medjava.ro/feed.php">
        <title>Med Java - java-script</title>
        <description></description>
        <link>https://medjava.ro/</link>
        <image rdf:resource="https://medjava.ro/lib/exe/fetch.php?media=wiki:dokuwiki.svg" />
       <dc:date>2026-04-07T08:03:40+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:ajax-fetch&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:arrow-function-implicit-return&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:arrow-function-return-object&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:babel&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:bitwise-or-bitwise-and-ternary-optional-chaining-operators&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:closures&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:console-table-error-assert-group&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:double-not-operator&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:dynamic-function-invocation&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:falsy-truthy-values&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:fetch-using-async-await&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:filter-method&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:find-and-find-index-methods&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:for-in-vs-for-of&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:function-context&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:hello-world&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:high-order-function&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:hoisting&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:iife-programming-pattern&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:immutability&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:jquery-fetch&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:map-method&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:minification-uglification&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:multiple-inheritance&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:multiplication-table-generator&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:named-parameters-in-functions&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:null-vs-undefined&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:nullish-coalescing-vs-logicar-or-vs-logical-and&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:object-to-string-and-back&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:read-file&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:reduce&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:rest-vs-spread-operator&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:script-tag-placement&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:send-post-requests&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:slice-vs-splice-methods&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:strict-mode&amp;rev=1735842138&amp;do=diff"/>
                <rdf:li rdf:resource="https://medjava.ro/doku.php?id=java-script:useful-tools&amp;rev=1735842138&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://medjava.ro/lib/exe/fetch.php?media=wiki:dokuwiki.svg">
        <title>Med Java</title>
        <link>https://medjava.ro/</link>
        <url>https://medjava.ro/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:ajax-fetch&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>ajax-fetch</title>
        <link>https://medjava.ro/doku.php?id=java-script:ajax-fetch&amp;rev=1735842138&amp;do=diff</link>
        <description>Ajax fetch example

AJAX (Asynchronous JavaScript and XML) and async JavaScript both deal with asynchronous behavior in JavaScript, but they are used for different things.

AJAX is a technique that allows a web page to communicate with a server and update its content without refreshing the page. AJAX can be done using vanilla JavaScript (usually with the</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:arrow-function-implicit-return&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>arrow-function-implicit-return</title>
        <link>https://medjava.ro/doku.php?id=java-script:arrow-function-implicit-return&amp;rev=1735842138&amp;do=diff</link>
        <description>Java Script Arrow Functions Implicit Return

Arrow functions allow for a concise syntax that can include an implicit return. 

Syntax:


const functionName = (parameters) =&gt; expression;


The expression right after the =&gt; will be implicitly returned. This is particularly useful for simple, one-liner functions.</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:arrow-function-return-object&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>arrow-function-return-object</title>
        <link>https://medjava.ro/doku.php?id=java-script:arrow-function-return-object&amp;rev=1735842138&amp;do=diff</link>
        <description>Returning an Object from an arrow function

If you want to return the object from the arrow function, you&#039;ll need to either use the return keyword:


const getObject = () =&gt; {
  return { key: &#039;value&#039; };
};


Or use parentheses to make it an implicit return of an object literal:</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:babel&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>babel</title>
        <link>https://medjava.ro/doku.php?id=java-script:babel&amp;rev=1735842138&amp;do=diff</link>
        <description>Babel

Use cases

Babel was mainly used to transpile (compile) ES6 code into ES5 or older version of ES (ECMAScript). 

Latest versions of Node.js (for example 16.15.1) already has good support for ES6, so babel may not be needed. 


But, there are still situations where using Babel can be beneficial:</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:bitwise-or-bitwise-and-ternary-optional-chaining-operators&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>bitwise-or-bitwise-and-ternary-optional-chaining-operators</title>
        <link>https://medjava.ro/doku.php?id=java-script:bitwise-or-bitwise-and-ternary-optional-chaining-operators&amp;rev=1735842138&amp;do=diff</link>
        <description>Java Script | Bitwise OR, ^ Bitwise XOR, &amp; Bitwise AND, ? Ternary Conditional Operator and ?. Optional Chaining Operator

In JavaScript, there are the | (bitwise OR) and &amp; (bitwise AND) operators, which are different from || and &amp;&amp;. These operators perform bitwise operations, which means</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:closures&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>closures</title>
        <link>https://medjava.ro/doku.php?id=java-script:closures&amp;rev=1735842138&amp;do=diff</link>
        <description>Java Script Closures

A closure is a function that remembers the variables and scope of its outer (enclosing) function, even after the outer function has finished executing. 
It “closes over” the variables it needs, hence the name “closure.”</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:console-table-error-assert-group&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>console-table-error-assert-group</title>
        <link>https://medjava.ro/doku.php?id=java-script:console-table-error-assert-group&amp;rev=1735842138&amp;do=diff</link>
        <description>Java Script Console Error, Table, Assert, Group

Console table

Along with console.log, console.info, console.warn and console.error, there is console.table which is very useful to print data in a tabular format (for objects, arrays and arrays of objects).</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:double-not-operator&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>double-not-operator</title>
        <link>https://medjava.ro/doku.php?id=java-script:double-not-operator&amp;rev=1735842138&amp;do=diff</link>
        <description>!! Double not operator

The double NOT operator (!!) in JavaScript is a bit of a trick that converts any value to its corresponding boolean value.

How it works:

	*  The first ! negates the value, converting it to its opposite boolean value. If the original value is truthy, this results in</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:dynamic-function-invocation&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>dynamic-function-invocation</title>
        <link>https://medjava.ro/doku.php?id=java-script:dynamic-function-invocation&amp;rev=1735842138&amp;do=diff</link>
        <description>Dynamic Function Invocation

The object[method](...) syntax is a common pattern in JavaScript that allows you to dynamically call a method on an object using a variable for the method name.

This pattern can be useful in various scenarios where you need to</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:falsy-truthy-values&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>falsy-truthy-values</title>
        <link>https://medjava.ro/doku.php?id=java-script:falsy-truthy-values&amp;rev=1735842138&amp;do=diff</link>
        <description>Java Script Falsy and Truthy Values

Falsy values
A falsy value is a value considered false if it&#039;s encountered in a boolean context.
These are the falsy values:

	*  false: The keyword false itself is obviously considered falsy.
	*  0, -0, 0n, -0n: The number zero (including its negative counterpart and big int) is considered falsy.</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:fetch-using-async-await&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>fetch-using-async-await</title>
        <link>https://medjava.ro/doku.php?id=java-script:fetch-using-async-await&amp;rev=1735842138&amp;do=diff</link>
        <description>Fetch using async/await

Introduction

Async/Await is part of the ES2017 specification and provides a more streamlined syntax for dealing with promises, leading to cleaner, easier-to-read code. 

Async/Await uses JavaScript fetch API (which returns promises) for making HTTP requests.</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:filter-method&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>filter-method</title>
        <link>https://medjava.ro/doku.php?id=java-script:filter-method&amp;rev=1735842138&amp;do=diff</link>
        <description>Java Script Filter Method

filter() method is used to create a new array with all elements that pass the test implemented by the provided function. 


Syntax:


const newArray = array.filter(callback(element, index, array), thisArg);


callback: A function that is called for every element of the array. If this function returns true, the element is included in the new array.</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:find-and-find-index-methods&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>find-and-find-index-methods</title>
        <link>https://medjava.ro/doku.php?id=java-script:find-and-find-index-methods&amp;rev=1735842138&amp;do=diff</link>
        <description>Java Script Find / Find Index methods

Unlike filter method that returns all the matching elements, find and findIndex will stop at the first matching element found.

Find

The find method returns the first element in an array that satisfies a given test function. If no elements satisfy the test, it returns</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:for-in-vs-for-of&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>for-in-vs-for-of</title>
        <link>https://medjava.ro/doku.php?id=java-script:for-in-vs-for-of&amp;rev=1735842138&amp;do=diff</link>
        <description>For In vs For Of

The for...in and for...of loops are used to iterate over the properties of objects or elements of an iterable, but they do it in different ways.

For In

The for...in loop iterates over all enumerable properties of an object, including inherited ones.</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:function-context&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>function-context</title>
        <link>https://medjava.ro/doku.php?id=java-script:function-context&amp;rev=1735842138&amp;do=diff</link>
        <description>Java Script Function Context

This

this keyword relates to the context on which it is run. 

person.sayHello() =&gt; context here is person 

person.spouse.sayHello(); =&gt; context is spouse 

sayHello() =&gt; context is window for web browsers, globalThis for Node.js &gt;=12 or</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:hello-world&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>hello-world</title>
        <link>https://medjava.ro/doku.php?id=java-script:hello-world&amp;rev=1735842138&amp;do=diff</link>
        <description>Java Script Hello World

The following script will display &#039;Hello World&#039; both in a popup window and in the browser&#039;s console. To execute the script, it must be run within a web browser. 

HTML + JS code in the same file


&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;title&gt;Hello World!&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;h1&gt;Hello World! from JS in a script tag&lt;/h1&gt;
    &lt;script&gt;
        alert(&#039;Hello world!&#039;);
        const h1 = document.querySelector(&#039;h1&#039;);
        console.log(h…</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:high-order-function&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>high-order-function</title>
        <link>https://medjava.ro/doku.php?id=java-script:high-order-function&amp;rev=1735842138&amp;do=diff</link>
        <description>Java Script HOF (High Order Function)

(HOF) is a function that takes one or more functions as arguments and/or returns a function as its result. HOFs are a powerful feature in JavaScript and enable functional programming patterns. 


A function qualifies as HOF if it does any of the following:</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:hoisting&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>hoisting</title>
        <link>https://medjava.ro/doku.php?id=java-script:hoisting&amp;rev=1735842138&amp;do=diff</link>
        <description>Java Script Hoisting

Hoisting in JavaScript is a behavior where variable and function declarations are moved, or “hoisted,” to the top of their containing scope during the compilation phase, before the code is executed. It&#039;s important to note that only the declarations are hoisted, not the initializations.</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:iife-programming-pattern&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>iife-programming-pattern</title>
        <link>https://medjava.ro/doku.php?id=java-script:iife-programming-pattern&amp;rev=1735842138&amp;do=diff</link>
        <description>Java Script Immediately Invoked Function Expression Programming Pattern

An IIFE (Immediately Invoked Function Expression) is a common JavaScript programming pattern used to execute a JavaScript function as soon as it is defined. 



The primary reason to use an IIFE is to obtain</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:immutability&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>immutability</title>
        <link>https://medjava.ro/doku.php?id=java-script:immutability&amp;rev=1735842138&amp;do=diff</link>
        <description>Ensuring immutability in Java Script

Ensuring immutability in JavaScript means creating objects and values that cannot be changed once they are created. 
 While JavaScript does not have built-in support for immutability in the way that some other languages do, there are several practices and libraries that you can use to achieve this goal.</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:jquery-fetch&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>jquery-fetch</title>
        <link>https://medjava.ro/doku.php?id=java-script:jquery-fetch&amp;rev=1735842138&amp;do=diff</link>
        <description>JQuery fetch example

This example is using jquery to fetch data from a remote server.
See also examples using Java Script async/await, or AJAX style.


&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;script src=&quot;https://code.jquery.com/jquery-3.6.0.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
 
&lt;div id=&quot;content&quot;&gt;&lt;/div&gt;
 
&lt;script&gt;
function loadUsers() {
  $.ajax({
    url: &#039;https://api.github.com/users&#039;,
    method: &#039;GET&#039;,
    dataType: &#039;json&#039;,
    success: function(users) {
      var html = &#039;&#039;;
      for (var user of use…</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:map-method&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>map-method</title>
        <link>https://medjava.ro/doku.php?id=java-script:map-method&amp;rev=1735842138&amp;do=diff</link>
        <description>Java Script Map Method

Map is a very common and useful method for creating a new array from an existing one by applying a function to every element. 

Syntax:


const newArray = oldArray.map(function(currentValue, index, array) {
  // Return element for newArray
});</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:minification-uglification&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>minification-uglification</title>
        <link>https://medjava.ro/doku.php?id=java-script:minification-uglification&amp;rev=1735842138&amp;do=diff</link>
        <description>Minification and Uglification in Java Script

Minification and uglification are techniques to make your JavaScript files smaller, and sometimes obfuscate the code, so it&#039;s harder to read. This can lead to faster load times and a little extra security through obscurity</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:multiple-inheritance&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>multiple-inheritance</title>
        <link>https://medjava.ro/doku.php?id=java-script:multiple-inheritance&amp;rev=1735842138&amp;do=diff</link>
        <description>Java Script Multiple Inheritance

extends
“mixins”

Java Script Mixins

Mixins using class syntax

A mixin is a class whose methods are intended to be added to (or “mixed in” to) other classes. 

AnimalMixin is a function that takes a base class and returns a new class that extends the base class and adds the eats method.</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:multiplication-table-generator&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>multiplication-table-generator</title>
        <link>https://medjava.ro/doku.php?id=java-script:multiplication-table-generator&amp;rev=1735842138&amp;do=diff</link>
        <description>Multiplication Table Generator

For client side (web browser)

This is a simple script to print a multiplication table generator using simple java script and html. 

Output example:



All code js + html in the same file


&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;script&gt;

            function createMultiplicationTable(rows, columns) {
                let html = &#039;&lt;table&gt;&#039;;

                for(let rowNumber = 1; rowNumber &lt;= rows; rowNumber++) {
                    html = html + &#039;&lt;tr&gt;&#039;;

      …</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:named-parameters-in-functions&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>named-parameters-in-functions</title>
        <link>https://medjava.ro/doku.php?id=java-script:named-parameters-in-functions&amp;rev=1735842138&amp;do=diff</link>
        <description>Java Script Named Parameters In Functions

To use named parameters, we can pass an object to a function and then access the properties of that object within the function.

This approach makes the code more readable and allows you to easily pass multiple parameters to a function, including optional parameters with default values:</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:null-vs-undefined&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>null-vs-undefined</title>
        <link>https://medjava.ro/doku.php?id=java-script:null-vs-undefined&amp;rev=1735842138&amp;do=diff</link>
        <description>Null vs Undefined

null and undefined are both special values that indicate the absence of a value. However, they are used in slightly different contexts and have some differences in behavior.

Null

null is a value that represents no value or no object</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:nullish-coalescing-vs-logicar-or-vs-logical-and&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>nullish-coalescing-vs-logicar-or-vs-logical-and</title>
        <link>https://medjava.ro/doku.php?id=java-script:nullish-coalescing-vs-logicar-or-vs-logical-and&amp;rev=1735842138&amp;do=diff</link>
        <description>|| Logical OR vs ?? Nullish Coalescing vs &amp;&amp; Logical AND

The ||, ??, and &amp;&amp; operators are used to perform different types of logical operations.

|| (Logical OR)

The || operator returns the first truthy value it encounters or the last value if none are truthy</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:object-to-string-and-back&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>object-to-string-and-back</title>
        <link>https://medjava.ro/doku.php?id=java-script:object-to-string-and-back&amp;rev=1735842138&amp;do=diff</link>
        <description>Object to String and String to Object

These actions are useful for:

Data Interchange: When communicating with a server or other systems, data is often sent and received as JSON strings. JSON.stringify and JSON.parse are used to serialize and deserialize data to and from this format.</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:read-file&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>read-file</title>
        <link>https://medjava.ro/doku.php?id=java-script:read-file&amp;rev=1735842138&amp;do=diff</link>
        <description>How to read the content of a file (both web and node.js)

Read a file in web browser

The following script reads the content of a file selected by the user and then displays those contents in a &lt;pre&gt; element. 
When the “Read File” button is clicked, the</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:reduce&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>reduce</title>
        <link>https://medjava.ro/doku.php?id=java-script:reduce&amp;rev=1735842138&amp;do=diff</link>
        <description>Java Script Reduce function

reduce is a method that applies a function against an accumulator and each element in the array (from left to right) to reduce it to a single value. 



This can be very useful for tasks such as summing all the values in an array or reducing an array of objects into a more useful structure.</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:rest-vs-spread-operator&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>rest-vs-spread-operator</title>
        <link>https://medjava.ro/doku.php?id=java-script:rest-vs-spread-operator&amp;rev=1735842138&amp;do=diff</link>
        <description>Rest vs Spread operator

The rest operator (...) and the spread operator (...) in JavaScript are written the same way but are used for two different purposes. 

Their usage depends on the context, and they perform opposite operations.
Rest Operator</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:script-tag-placement&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>script-tag-placement</title>
        <link>https://medjava.ro/doku.php?id=java-script:script-tag-placement&amp;rev=1735842138&amp;do=diff</link>
        <description>Script tag placement

The &lt;script&gt; tag can be placed in both the &lt;head&gt; and &lt;body&gt; sections of an HTML document, and the location can affect how the script is executed.

Placing the Script in the Head

Traditionally, scripts were often placed in the</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:send-post-requests&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>send-post-requests</title>
        <link>https://medjava.ro/doku.php?id=java-script:send-post-requests&amp;rev=1735842138&amp;do=diff</link>
        <description>Send POST requests

By default, web browsers use the GET method when you enter a URL in the address bar. This means you can&#039;t directly send a POST request using the address bar of a browser. 


However, there are several ways to send POST requests from a web browser:</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:slice-vs-splice-methods&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>slice-vs-splice-methods</title>
        <link>https://medjava.ro/doku.php?id=java-script:slice-vs-splice-methods&amp;rev=1735842138&amp;do=diff</link>
        <description>Java Script Slice vs Splice methods

Slice

slice() method returns a shallow copy of a portion of an array into a new array object.


Syntax:


array.slice(begin, end)


begin (optional): The starting index (inclusive).
end (optional): The ending index (</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:strict-mode&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>strict-mode</title>
        <link>https://medjava.ro/doku.php?id=java-script:strict-mode&amp;rev=1735842138&amp;do=diff</link>
        <description>Java Script Strict mode

Description

The “use strict” directive in JavaScript was introduced in ES5 to help you catch common coding mistakes and “unsafe” actions like assigning values to read-only variables or using some of the reserved keywords.</description>
    </item>
    <item rdf:about="https://medjava.ro/doku.php?id=java-script:useful-tools&amp;rev=1735842138&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-01-02T18:22:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>useful-tools</title>
        <link>https://medjava.ro/doku.php?id=java-script:useful-tools&amp;rev=1735842138&amp;do=diff</link>
        <description>Useful Java Script related frameworks / tools

These tools can enhance your workflow, increase productivity, and enable you to write more robust and maintainable code:

	*  TypeScript: Adds static typing to JavaScript, which can make code easier to understand and debug.</description>
    </item>
</rdf:RDF>
