FacebookTwitterLinkedIn

English translation by ChatGPT

Ahmed Zayed 2/2/1/1 أساسيات الجافاسكريبت 'التعامل مع الأرقام'Ahmed Zayed 2/2/1/1 أساسيات الجافاسكريبت 'التعامل مع الأرقام'

Course

دورة تدريبية

2/2/1/1 أساسيات الجافاسكريبت 'التعامل مع الأرقام'

تطوير المواقع الإلكترونية MEAN-Stack from A to Z التأسيس Level1

غالبا ما تحتوي لغات البرمجة علي أكثر من datatype للتعامل مع الأرقام و لكن في الـ JS لا يوجد إلا نوع بيانات واحد و هو number من خلاله نستطيع التعامل مع الأرقام أي أن هذا النوع من البيانات يتعامل مع الأرقام الصحيحة و الأرقام العشرية دون الحاجة لإستخدام أنواع مختلفة من أنواع البيانات كما في اللغات الأخرى أيضا هناك نوع جديد من أنواع البيانات التي أضيفت مؤخرا (ES11 (ECMAScript 2020)) للغة جافاسكريبت و هي bigInt و هو نوع وجد للتعامل مع الأرقام الكبيرة التي لا يستطيع النوع number التعامل معها

الفرق بين number و bigInt

كما ذكرنا من قبل أن الجافاسكريبت صممت في البداية للتعامل مع مهام بسيطة و لم يكن من ضمنها التعامل مع بيانات علمية و هي أكثر انواع البيانات التي تحتاج لإستخدام الأرقام الكبيرة وتمثيلها بشكل صحيح لذلك كان النوع number كان يحتوي على خاصية تسمي MAX_SAFE_INTEGER و هو أكبر رقم يمكن التعامل معه و هو 9,007,199,254,740,991 و لذلك ظهر نوع bigInt تتعامل مع الأرقام الأكبر و بالطبع يتم أستخدامه في حالات خاصة و لذلك سنتناول نوع البيانات number لأنه النوع الأكثر استخداما وشيوعا

طريقة كتابة الأرقام

تدعم الـ JS أكثر من طريقة لكتابة الأرقام فرقم مثل 1000000 يمكن كتابته بالطرق التالية :
Code

          console.log(1000000);
          console.log(1_000_000);
          console.log(1e6);
          console.log(10**6);
    

طريقة تنسيق الأرقام

تقوم JS بتجاهل الأصفار بعد العلامة العشرية طالما لم تحتوي علي أرقام أخري غير الصفر
Code

          console.log(100.00); // 100
    
بينما تقوم بكتابة الأرقام بعد العلامة العشرية لو إحتوت علي رقم غير الصفر
Code

    console.log(100.001);//100.001
    
و يمكن التحكم في عدد الأرقام بعد العلامة العشرية مثل
Code

          (100.0011111).toFixed(2) // 100.00
    
أيضا يمكن كتابتها عن طريق
Code

          100.0011111.toFixed(2)
    
و في حالة عدم وجود أرقام بعد العلامة العشرية يتم كتابة الجملة بتلك الطريقة
Code

          100..toFixed(2) // 100.00
    
يلاحظ ان toFixed تقوم بتحويل الرقم لنص مثلها مثل toString
Code

          100.00.toString() //100
    
و لكن toString لا تتحكم في عدد الأرقام بعد العلامة العشرية فهي تقوم بتحويل الرقم لنص , أيضا هناك فرق أخر فـ toString يمكنها تحويل الرقم إلي نص مكتوب بأي نظام كتابة أرقام فيمكن تمرير argument لها عبارة عن رقم من 2 إلي 36 (تقوم بإرجاع خطأ في حالة كون الرقم أصغر من 2 أو أكبر كم 36) و يمثل الرقم هذا طريق كتابة نظام رقمي حيث رقم 2 يقوم بكتابة رقم ثنائي و 8 يقوم بكتابة نظام ثماني و هكذا و بالطبع لو قمنا بتمرير رقم 10 سيكون الناتج مثل الرقم لاننا نستخدم النظام العشري في كتابتنا للأرقام مثل:
Code

          100..toString(2) // 1100100
          100..toString(8) // 144
          100..toString(10) // 100            
    

تحويل النصوص لأرقام

يمكن تحويل النصوص لأرقام بأكثر من طريقة مثل :

استخدام parseInt

Code

          parseInt('100') // 100
    
تقوم parseInt بتحويل النص لعدد صحيح أي أنها تتغاضي عن الأرقام الموجودة بعد الأرقام العشرية
Code

          parseInt('100.55') // 100
    
أيضا لو أحتوي النص المراد تحويله لرقم علي نصوص بعد الأرقام يتم استبعاد النص مثل
Code

          parseInt('100 hello') // 100
    
لكن في حالة كان النص مكتوب قبل الرقم لا يمكنها إحضار الرقم و بذلك تعطي نتيجة NaN و هي إختصار لـ not a number مثل
Code

          parseInt('hello 100') // NaN
    
يلاحظ أن في الـ JS أن الـ NaN يعتبر رقم فإذا قمت بإستخدام typeOf للكشف عن نوعه عن طريق الكود التالي:
console.log(typeof NaN);
ستجد النتيجة number يلاحظ أيضا أن JS لا تعتبر القيمة NaN لا تساوي نفسها , فمثلا إذا كتبنا الكود التالي
       
          if(1000 === 1000){
              console.log(true);
              }
              else
              {
               console.log(false);
               }
       
      
ستكون النتيجة true حيث 1000 تساوي 1000 بالفعل و لكن اذا قمنا بإعادة كتابة الكود بهذه الطريقة
          
              if(NaN === NaN){
                  console.log(true);
                  }
                  else
                  {
                   console.log(false);
                   }
          
         
ستجد أن النتيجة تكون false و ذلك لآن JS تعتبر أن NaN ليست دائما تحدث لنفس السبب فمثلا قد تكون نتيجة لمحاولة تحويل نص لرقم مثل
          
         parseInt('hello') // NaN
          
أو نتيجة محاولة إجراء عملية حسابية بين رقم و بين نص مثل الكود التالي
              
              console.log(100 * 'hi')
              
ستكون النتيجة أيضا NaN (مهما كانت العملية الحسابية المراد تحقيقها إلا عملية الجمع ففي تلك الحالة تعتبرها JS محاولة للصق نصين معا string concatenation مثل الكود التالي)
                  
              console.log(100 + 'hi') // 100hi
                  
و لذلك تعتبر JS أن NaN لا تساوي NaN نظرا لآنها قد تكون ناتجة من حالات مختلفة.

استخدام parseFloat

و تستخدم لتحويل الأرقام ذات الكسور مثل
Code

          parseFloat('100.55') // 100.55
    
و تتجاهل الأصفار بعد العلامة العشرية عندما تكون أصفار فقط بلا أرقام أخرى مثل
Code

          parseFloat('100.00') // 100
    
أيضا كما شقيقتها (parseInt) تستخرج parseFloat الرقم وحده لو كان مصحوبا بنص مثل
Code

          parseFloat('100.55 hi') // 100.55
    

الـ Number Object

يستخدم أيضا للتعامل مع الأرقام حيث يقوم الـ constractor الخاص به بإنشاء رقم من القيمة التي يتم إعطاءها له مثل
Code

          Number('100') // 100
    
يتميز أيضا بإنه يقوم بتحويل القيم القابلة للتحويل الرقمي إلي أرقام مثل الأمثلة التالية
Code

          Number(true) // 1
          Number(false) // 0
          Number(null) //0
    
و علي عكس الـ parse فإن الـ number لا تقوم بإستخلاص الأرقام إذا كانت متبوعة بنصوص مثل
Code

          Number('100 hi') // NaN
    
و أيضا يتغاضي الـ Number عن الأرقام بعد العلامة إذا كانت أصفار مثل
Code

          Number('100.00') // 100
    
بينما تحتفظ بالأرقام بعد العلامة إذا كانت لا تساوي صفر مثل
Code

          Number('100.50') // 100.5
    
أيضا يمكننا استخدام الـ method الـ Number.isInteger
Code

          let myValue = 100;
          console.log( Number.isInteger(myValue)); // true
          let myValue = -100;
          console.log( Number.isInteger(myValue)); // true
          let myValue = 100.5;
          console.log( Number.isInteger(myValue)); // false
    
يلاحظ في الكود السابق ان الرقم العشري ليس integer حيث انه float
Code

          let myValue = ‘hi’;
          console.log( Number.isInteger(myValue)); // false
          let myValue = true;
          console.log( Number.isInteger(myValue)); // false
    
هناك أيضا الـ method الـ isNaN و هي تقوم بالكشف عن الرقم و تجيب بـ true اذا كان NaN و تجيب ب false في أي حالة أخري فمثلا
Code

          Number.isNaN(NaN) // true
          Number.isNaN(100) // false
          Number.isNaN(‘100’) // false
          Number.isNaN('hi') // false
    
الملاحظ أن Number.isNaN('hi') من المفروض أن تكون NaN أي أن النتيجة يجب أن تكون بـ true و لكنها تأتي بـ false أيضا و هذا بسبب أن الـ function لا تقوم بتحويل القيم المدخلة لها مثلا لا تقوم بتحويل النص ‘hi’ فينتج عنها NaN فتقوم بإرجاع true هي فقط تقارن المدخل لها هل هو NaN أم لا و لذلك تعتبر ‘hi’ عبارة عن string و الـ string لا يساوي NaN فتقوم بإرجاع false بينما إذا قمنا بتعديل الكود لما يلي:
Code

          Number.isNaN(Number('hi'))
    
تقوم Number('hi') بتحويل النص لرقم فينتج عن تلك العملية NaN فيتم الكشف عنها بالكود السابق فينتج عنه true أي أنها فعلا not a number .
و بالطبع هذه الطريقة ليست فعالة في الكشف عن المتغيرات أو القيم التي قام المستخدم بإدخالها و عوضا عن ذلك نستخدم function تسمي isNaN و هي لا تنتمي للـ Number حيث يمكن استدعائها من الـ global scope مثل

          isNaN('hi') // true
           isNaN('100') // false
      
أيضا من ضمن ما الـ properties المتضمنة في الـ Number هو Number.MAX_SAFE_INTEGER و هو يوضح أكبر رقم صحيح يمكن التعامل معه في الـ JS و يكون أمن (أمن بمعني لا يسبب أخطاء حيث أن إستخدام أرقام أكبر منه في عمليات حسابية قد يسبب أخطاء في النتائج) و هو الرقم التالي:
Code

    console.log(Number.MAX_SAFE_INTEGER) // 9007199254740991
    
و بالمثل هناك أصغر رقم أمن في الـ JS و هو:
Code

          console.log(Number.MIN_SAFE_INTEGER) // -9007199254740991
    
هناك properties أخري أيضا متعلقة بأكبر قيمة رقم صحيح يمكن التعامل معها في الـ JS و أيضا أصغير قيمة يمكن التعامل معها في الـ JS كما في الكود التالي:
Code

    console.log(Number.MAX_VALUE) //1.7976931348623157e+308
    console.log(Number.MIN_VALUE) // 5e-324
    
أي حتي لو حاولنا زيادة الـ MAX_VALUE عن طريق أي عملية حسابية فلن يزيد الرقم مثل
Code

          console.log(Number.MAX_VALUE + 1) //1.7976931348623157e+308
    
و أيضا لو حاولنا تقليل الـ MIN_VALUE عن طريق عملية طرح لن يتغير الرقم.

الـ Infinity

أيضا من الأرقام الخاصة مثل الـ NaN هناك رقم خاص أخر هو الـ Infinity و يمكن التأكد من كونه رقم عن طريق الكود التالي
Code

          console.log(typeof Infinity)  // number
    
و ينتج عن طريق قسمة أي رقم علي الصفر مثل:
Code

          console.log(100/ 0) // Infinity
    
أو ضرب الـ Number.MAX_VALUE في أي رقم أكبر من 1 مثل
Code

          console.log(Number.MAX_VALUE * 2 ) // Infinity
    
أيضا هناك السالب Infinity و نتج عن طريق قسمة أي رقم علي سالب صفر مثل
Code

          console.log(100 / -0 ) // Infinity
    

الـ Math

تتضمن الـ JS جزء خاص بالمعاملات الرياضية حيث يوفر العديد من العمليات المستخدمة في الرياضيات و أيضا الـ properties الخاصة بالرياضيات من أمثلتها الـ property الخاص بثابت الدائرة ط أو PI و يمكن الوصول له عن طريق
Code

          console.log(Math.PI ) // 3.141592653589793
    
و من أشهر العمليات الرياضية التي يوفرها الـ Math و أكثرها إستخداما: - الـ power أي رفع عدد لأس و يتم كتابتها مثل
Code

          console.log(Math.pow(2,3) ) // 8
    
و تأخد قيمتين الأولي العدد و الثانية تكون الأس الذي يرفع للعدد في المثال السابق 2^3 - تقريب الكسور و هي من أهم العمليات الرياضية التي نحتاجها و يمكن إجرائها بـ 3 طرق 1- التقريب لأقرب عدد صحيح مثلا لو عندي رقم 100.5 أو أكبر مثل 100.6 يتم تقريبها لـ 101 أما لو الكسر أصغر من 5 مثل 100.4 يتم تقريبها لـ 100 و نقوم بعمل تلك العملية عن طريق الـ method المسماه Math.round
Code

          console.log(Math.round(100.5)) // 101
          console.log(Math.round(100.6)) // 101
          console.log(Math.round(100.4)) // 100
    
2- التقريب لأعلي عدد صحيح , و في تلك الحالة يتم تقريب أي عدد بكسر للعدد الصحيح الأعلي منه عن طريق الـ Mathe.ceil
Code

          console.log(Math.ceil(100.5)) // 101
          console.log(Math.ceil(100.6)) // 101
          console.log(Math.ceil(100.4)) // 101
    
3- التقريب أصغر عدد صحيح , و في تلك الحالة يتم تقريب أي عدد بكسر للعدد الصحيح الأعلي منه عن طريق الـ Math.floor
Code

          console.log(Math.floor(100.5)) // 100
          console.log(Math.floor(100.6)) // 100
          console.log(Math.floor(100.4)) // 100
    
هناك method تقوم بنفس العملية السابقة و هي Method.trunc و هي تقوم بتجاهل الكسور و استخلاص الرقم الصحيح مثل
          
              console.log(Math.trunc(100.5)) // 100
              console.log(Math.trunc(100.6)) // 100
              console.log(Math.trunc(100.4)) // 100
          
         
- الـ random و هي method تقوم بتكوين بتوليد رقم عشوائي بين الـ 0 و الـ 1 في كل مرة يتم استخدامها ()Math.random بالطبع العمليات الرياضية كثيرة و متنوعة في أي لغة برمجة و الـ JS ليست استثناء و لكننا إكتفينا بأشهر العمليات المستخدمة بشكل متكرر.

1/1/2/2 JavaScript fundamentals 'Working with Numbers'

Web Development MEAN-Stack from A to Z Fundamentals Level1

Programming languages often have more than one datatype for dealing with numbers, but in JavaScript, there is only one datatype, which is `number`. Through this, we can handle numbers. This datatype deals with both integers and decimal numbers without the need for different datatypes as in other languages. There is also a new datatype that was recently added (ES11 (ECMAScript 2020)) to JavaScript, which is `bigInt`. This type was introduced to handle large numbers that the `number` type cannot handle.

The Difference Between `number` and `bigInt`

As mentioned earlier, JavaScript was initially designed to handle simple tasks, and it did not include handling scientific data, which often requires the use of large numbers and their correct representation. Therefore, the `number` type had a property called `MAX_SAFE_INTEGER`, which is the largest number that can be safely handled, and it is 9,007,199,254,740,991. This is why the `bigInt` type was introduced to handle larger numbers. However, it is used in specific cases, so we will focus on the `number` type, as it is the most commonly used.

Writing Numbers

JavaScript supports multiple ways to write numbers. For example, a number like 1,000,000 can be written in the following ways:
Code

              console.log(1000000);
              console.log(1_000_000);
              console.log(1e6);
              console.log(10**6);
        

Formatting Numbers

JavaScript ignores zeros after the decimal point if they are not followed by other numbers.
Code

              console.log(100.00); // 100
        
However, it writes numbers after the decimal point if they contain a non-zero digit.
Code

        console.log(100.001);//100.001
        
You can control the number of digits after the decimal point, like this:
Code

              (100.0011111).toFixed(2) // 100.00
        
It can also be written as:
Code

              100.0011111.toFixed(2)
        
If there are no digits after the decimal point, the statement is written as follows:
Code

              100..toFixed(2) // 100.00
        
Note that `toFixed` converts the number to a string, similar to `toString`.
Code

              100.00.toString() //100
        
However, `toString` does not control the number of digits after the decimal point; it simply converts the number to a string. There is also another difference: `toString` can convert the number to a string written in any numeral system by passing an argument ranging from 2 to 36 (it returns an error if the number is less than 2 or greater than 36). This number represents the numeral system, where 2 writes the number in binary, 8 in octal, and so on. If we pass 10, the result will be the same as the number because we use the decimal system for writing numbers, like this:
Code

              100..toString(2) // 1100100
              100..toString(8) // 144
              100..toString(10) // 100            
        

Converting Strings to Numbers

Strings can be converted to numbers in several ways, such as:

Using `parseInt`

Code

              parseInt('100') // 100
        
`parseInt` converts the string to an integer, meaning it ignores digits after the decimal point.
Code

              parseInt('100.55') // 100
        
Also, if the string to be converted contains text after the numbers, the text is ignored, like this:
Code

              parseInt('100 hello') // 100
        
However, if the text is written before the number, it cannot extract the number and returns `NaN`, which stands for "not a number," like this:
Code

              parseInt('hello 100') // NaN
        
Note that in JavaScript, `NaN` is considered a number. If you use `typeof` to check its type with the following code:
console.log(typeof NaN);
You will find the result is `number`. Also, note that JavaScript does not consider `NaN` equal to itself. For example, if we write the following code:
           
              if(1000 === 1000){
                  console.log(true);
                  }
                  else
                  {
                   console.log(false);
                   }
           
          
The result will be `true` because 1000 is indeed equal to 1000. However, if we rewrite the code as follows:
              
                  if(NaN === NaN){
                      console.log(true);
                      }
                      else
                      {
                       console.log(false);
                       }
              
             
You will find that the result is `false`. This is because JavaScript considers that `NaN` does not always occur for the same reason. For example, it could be the result of trying to convert text to a number, like this:
              
             parseInt('hello') // NaN
              
Or it could be the result of trying to perform an arithmetic operation between a number and text, like the following code:
                  
                  console.log(100 * 'hi')
                  
The result will also be `NaN` (regardless of the arithmetic operation, except for addition, in which case JavaScript considers it an attempt to concatenate two strings, like the following code):
                      
                  console.log(100 + 'hi') // 100hi
                      
Therefore, JavaScript considers that `NaN` is not equal to `NaN` because it could result from different cases.

Using `parseFloat`

This is used to convert numbers with fractions, like this:
Code

              parseFloat('100.55') // 100.55
        
It also ignores zeros after the decimal point if they are not followed by other numbers, like this:
Code

              parseFloat('100.00') // 100
        
Like its counterpart (`parseInt`), `parseFloat` extracts the number alone if it is accompanied by text, like this:
Code

              parseFloat('100.55 hi') // 100.55
        

The `Number` Object

This is also used to handle numbers. Its constructor creates a number from the value given to it, like this:
Code

              Number('100') // 100
        
It also has the advantage of converting values that can be converted to numbers, like the following examples:
Code

              Number(true) // 1
              Number(false) // 0
              Number(null) //0
        
Unlike `parse`, `Number` does not extract numbers if they are followed by text, like this:
Code

              Number('100 hi') // NaN
        
Also, `Number` ignores digits after the decimal point if they are zeros, like this:
Code

              Number('100.00') // 100
        
However, it retains digits after the decimal point if they are not zero, like this:
Code

              Number('100.50') // 100.5
        
We can also use the `Number.isInteger` method:
Code

              let myValue = 100;
              console.log( Number.isInteger(myValue)); // true
              let myValue = -100;
              console.log( Number.isInteger(myValue)); // true
              let myValue = 100.5;
              console.log( Number.isInteger(myValue)); // false
        
Note in the previous code that a decimal number is not an `integer` because it is a `float`.
Code

              let myValue = ‘hi’;
              console.log( Number.isInteger(myValue)); // false
              let myValue = true;
              console.log( Number.isInteger(myValue)); // false
        
There is also the `isNaN` method: This method checks if a number is `NaN` and returns `true` if it is, and `false` otherwise. For example:
Code

              Number.isNaN(NaN) // true
              Number.isNaN(100) // false
              Number.isNaN(‘100’) // false
              Number.isNaN('hi') // false
        
Note that `Number.isNaN('hi')` should be `NaN`, meaning the result should be `true`, but it returns `false`. This is because the function does not convert the input values. For example, it does not convert the text `'hi'`, which results in `NaN`, so it returns `true`. It only compares the input to see if it is `NaN` or not. Therefore, `'hi'` is considered a `string`, and a `string` is not equal to `NaN`, so it returns `false`. However, if we modify the code as follows:
Code

              Number.isNaN(Number('hi'))
        
`Number('hi')` converts the text to a number, resulting in `NaN`, which is then detected by the previous code, resulting in `true`, meaning it is indeed `not a number`.
Of course, this method is not effective for detecting variables or values entered by the user. Instead, we use a function called `isNaN`, which does not belong to `Number`. It can be called from the global scope, like this:

              isNaN('hi') // true
               isNaN('100') // false
          
Another property included in `Number` is `Number.MAX_SAFE_INTEGER`, which specifies the largest safe integer that can be handled in JavaScript (safe meaning it does not cause errors, as using larger numbers in arithmetic operations may cause errors in results). This number is:
Code

        console.log(Number.MAX_SAFE_INTEGER) // 9007199254740991
        
Similarly, there is the smallest safe integer in JavaScript, which is:
Code

              console.log(Number.MIN_SAFE_INTEGER) // -9007199254740991
        
There are also other properties related to the largest and smallest values that can be handled in JavaScript, as shown in the following code:
Code

        console.log(Number.MAX_VALUE) //1.7976931348623157e+308
        console.log(Number.MIN_VALUE) // 5e-324
        
Even if we try to increase `MAX_VALUE` through any arithmetic operation, the number will not increase, like this:
Code

              console.log(Number.MAX_VALUE + 1) //1.7976931348623157e+308
        
Similarly, if we try to decrease `MIN_VALUE` through subtraction, the number will not change.

`Infinity`

Another special number, like `NaN`, is `Infinity`. You can confirm that it is a number using the following code:
Code

              console.log(typeof Infinity)  // number
        
It is produced by dividing any number by zero, like this:
Code

              console.log(100/ 0) // Infinity
        
Or by multiplying `Number.MAX_VALUE` by any number greater than 1, like this:
Code

              console.log(Number.MAX_VALUE * 2 ) // Infinity
        
There is also negative `Infinity`, which is produced by dividing any number by negative zero, like this:
Code

              console.log(100 / -0 ) // Infinity
        

`Math`

JavaScript includes a special part for mathematical operations, providing many operations used in mathematics, as well as mathematical properties. One example is the property for the constant π (pi), which can be accessed as follows:
Code

              console.log(Math.PI ) // 3.141592653589793
        
Some of the most commonly used mathematical operations provided by `Math` include: - `power`, which raises a number to a power, written as:
Code

              console.log(Math.pow(2,3) ) // 8
        
It takes two values: the first is the number, and the second is the exponent. In the previous example, it is 2^3. - Rounding fractions, which is one of the most important mathematical operations we need, can be done in three ways: 1- Rounding to the nearest integer. For example, if we have a number like 100.5 or higher, such as 100.6, it is rounded to 101. If the fraction is less than 5, such as 100.4, it is rounded to 100. This is done using the `Math.round` method:
Code

              console.log(Math.round(100.5)) // 101
              console.log(Math.round(100.6)) // 101
              console.log(Math.round(100.4)) // 100
        
2- Rounding up to the nearest integer. In this case, any number with a fraction is rounded up to the next integer using `Math.ceil`:
Code

              console.log(Math.ceil(100.5)) // 101
              console.log(Math.ceil(100.6)) // 101
              console.log(Math.ceil(100.4)) // 101
        
3- Rounding down to the nearest integer. In this case, any number with a fraction is rounded down to the previous integer using `Math.floor`:
Code

              console.log(Math.floor(100.5)) // 100
              console.log(Math.floor(100.6)) // 100
              console.log(Math.floor(100.4)) // 100
        
There is a method that performs the same operation as above, which is `Math.trunc`. It ignores fractions and extracts the integer part, like this:
              
                  console.log(Math.trunc(100.5)) // 100
                  console.log(Math.trunc(100.6)) // 100
                  console.log(Math.trunc(100.4)) // 100
              
             
- `random`, which is a method that generates a random number between 0 and 1 each time it is used (`Math.random()`). Of course, mathematical operations are numerous and varied in any programming language, and JavaScript is no exception. However, we have covered the most commonly used operations.

February 27, 2025

Read More
إقرأ المزيد

دورة تدريبية

Course

4/2/1/1 أساسيات الجافاسكريبت 'التعامل مع التاريخ و الوقت'

1/1/2/4 JavaScript fundamentals 'Handling Date and Time'

دورة تدريبية

Course

9/2/1/1 أساسيات الجافاسكريبت 'الـ Objects'

1/1/2/9 JavaScript fundamentals: 'Objects'

مشكلة التسويق الرقمي بين الإختزال و الأوهام

The Problem of Digital Marketing Between Reductionism and Illusions

دورة تدريبية

Course

3/2/1/1 أساسيات الجافاسكريبت 'التعامل مع النصوص'

1/1/2/3 JavaScript fundamentals 'Working with Strings'

دورة تدريبية

Course

5/2/1/1 أساسيات الجافاسكريبت 'الجمل الشرطية Conditional statements'

1/1/2/5 JavaScript fundamentals 'Conditional Statements'

Keywords
كلمات مفتاحية

دورة الـ mean-stack from a to z دورة النود بالعربي دورة تطوير المواقع الإلكترونية دورة الأنجولر بالعربي mean-stack دورة الـ

course mean-stack from a to zcourse mean-stack from a to znode js arabic courseweb development courseangular arabic coursemean-stack course

© 2026 Ahmed Zayed. All rights reserved.© 2026 كل الحقوق محفوظة أحمد زايد