JS ကျူတိုရီရယ်

JS ပင်မ JS မိတ်ဆက် JS ဘယ်သွားမလဲ။ JS Output JS ထုတ်ပြန်ချက် JS Syntax JS မှတ်ချက်များ JS အပြောင်းအလဲများ JS Let JS Const JS အော်ပရေတာများ JS ဂဏန်းသင်္ချာ JS တာဝန် JS ဒေတာအမျိုးအစားများ JS လုပ်ဆောင်ချက်များ JS အရာဝတ္ထုများ JS ပွဲများ JS စာတန်းများ JS စာတန်းနည်းလမ်းများ JS စာတန်းရှာဖွေမှု JS String Templates JS နံပါတ်များ JS နံပါတ်နည်းလမ်းများ JS Arrays JS Array Methods JS Array အမျိုးအစား JS Array Iteration JS Array Const JS ရက်စွဲများ JS ရက်စွဲပုံစံများ JS နေ့စွဲ နည်းလမ်းများ ရယူပါ။ JS ရက်စွဲ သတ်မှတ်နည်းလမ်းများ JS သင်္ချာ JS Random JS Booleans JS နှိုင်းယှဉ်မှုများ JS အခြေအနေများ JS Switch JS Loop For JS Loop For In JS Loop For Of JS Loop While JS Break JS Iterables JS အစုံများ JS Maps JS အမျိုးအစား JS အမျိုးအစားပြောင်းခြင်း။ JS Bitwise JS RegExp JS အမှားများ JS နယ်ပယ် JS Hoisting JS တင်းကျပ်သောမုဒ် JS ဒီ Keyword ပါ။ JS Arrow Function JS သင်တန်းများ JS JSON JS Debugging JS စတိုင်လမ်းညွှန် JS အကောင်းဆုံးအလေ့အကျင့်များ JS အမှားများ JS စွမ်းဆောင်ရည် JS သီးသန့်စကားလုံးများ

JS ဗားရှင်းများ

JS ဗားရှင်းများ JS 2009 (ES5) JS 2015 (ES6) JS 2016 JS 2017 JS 2018 JS IE / Edge JS သမိုင်း

JS အရာဝတ္ထုများ

Object အဓိပ္ပါယ်ဖွင့်ဆိုချက် Object Properties များ အရာဝတ္ထုနည်းလမ်းများ အရာဝတ္ထုပြသခြင်း။ အရာဝတ္ထု ဆက်စပ်ပစ္စည်းများ Object Constructors များ Object Prototypes Object Iterables အရာဝတ္ထုအစုံများ အရာဝတ္ထုမြေပုံများ Object ကိုးကား

JS လုပ်ဆောင်ချက်များ

လုပ်ဆောင်ချက် အဓိပ္ပါယ်ဖွင့်ဆိုချက် လုပ်ဆောင်ချက် ကန့်သတ်ချက်များ Function Invocation လုပ်ဆောင်ချက်ခေါ်ဆိုမှု လုပ်ဆောင်ချက်ကို အသုံးပြုပါ။ Function ပိတ်ခြင်းများ

JS သင်တန်းများ

အတန်းမိတ်ဆက် Class Inheritance အတန်းထဲမှာလည်း

JS Async

JS ပြန်ခေါ်မှုများ JS Asynchronous JS ကတိများ JS Async/Await

JS HTML DOM

DOM မိတ်ဆက် DOM နည်းလမ်းများ DOM စာရွက်စာတမ်း DOM ဒြပ်စင်များ DOM HTML DOM ပုံစံများ DOM CSS DOM အန်နီမေးရှင်းများ DOM ပွဲများ DOM ဖြစ်ရပ် နားထောင်သူ DOM လမ်းညွှန် DOM Nodes DOM စုစည်းမှုများ DOM Node စာရင်းများ

JS Browser BOM

JS Window JS မျက်နှာပြင် JS တည်နေရာ JS သမိုင်း JS Navigator JS Popup သတိပေးချက် JS Timing JS Cookies

JS ဝဘ် API များ

ဝဘ် API မိတ်ဆက် ဝဘ်ဖောင် API ဝဘ်သမိုင်း API ဝဘ်သိုလှောင်မှု API Web Worker API Web Fetch API ဝဘ် Geolocation API

JS AJAX

AJAX နိဒါန်း AJAX XMLHttp AJAX တောင်းဆိုချက် AJAX တုံ့ပြန်မှု AJAX XML ဖိုင် AJAX PHP AJAX ASP AJAX ဒေတာဘေ့စ် AJAX အပလီကေးရှင်းများ AJAX ဥပမာများ

JS JSON

JSON မိတ်ဆက် JSON Syntax JSON နှင့် XML JSON ဒေတာအမျိုးအစားများ JSON Parse JSON Stringify JSON အရာဝတ္ထုများ JSON Arrays JSON ဆာဗာ JSON PHP JSON HTML JSON JSONP

JS နှင့် jQuery

jQuery ရွေးချယ်မှုများ jQuery HTML jQuery CSS jQuery DOM

JS ဂရပ်ဖစ်

JS ဂရပ်ဖစ် JS Canvas JS Plotly JS Chart.js JS Google Chart JS D3.js

JS ဥပမာများ

JS ဥပမာများ JS HTML DOM JS HTML ထည့်သွင်းမှု JS HTML Objects JS HTML ပွဲများ JS Browser JS တည်းဖြတ်သူ JS လေ့ကျင့်ခန်းများ JS Quiz JS လက်မှတ်

JS ကိုးကားချက်များ

JavaScript Objects HTML DOM အရာဝတ္ထုများ


JavaScript သင်္ချာအရာဝတ္ထု

JavaScript Math object သည် ဂဏန်းများပေါ်တွင် သင်္ချာဆိုင်ရာ လုပ်ဆောင်ချက်များကို လုပ်ဆောင်နိုင်စေပါသည်။

ဥပမာ

Math.PI;

သင်္ချာအရာဝတ္ထု

အခြားအရာဝတ္ထုများနှင့်မတူဘဲ သင်္ချာအရာဝတ္တုတွင် constructor မရှိပါ။

သင်္ချာအရာဝတ္ထုသည် တည်ငြိမ်သည်။

Math object တစ်ခုကို ဦးစွာ မဖန်တီးဘဲ method နှင့် properties အားလုံးကို သုံးနိုင်သည်။


သင်္ချာဂုဏ်သတ္တိများ (ကိန်းသေများ)

သင်္ချာပစ္စည်းတစ်ခုခုအတွက် syntax သည် : .Math.property

JavaScript သည် သင်္ချာဂုဏ်သတ္တိများအဖြစ် ဝင်ရောက်နိုင်သော သင်္ချာကိန်းသေ ၈ လုံးကို ပံ့ပိုးပေးသည်-

ဥပမာ

Math.E        // returns Euler's number
Math.PI       // returns PI
Math.SQRT2    // returns the square root of 2
Math.SQRT1_2  // returns the square root of 1/2
Math.LN2      // returns the natural logarithm of 2
Math.LN10     // returns the natural logarithm of 10
Math.LOG2E    // returns base 2 logarithm of E
Math.LOG10E   // returns base 10 logarithm of E

သင်္ချာနည်းများ

သင်္ချာအတွက် syntax သည် မည်သည့်နည်းလမ်းများဖြစ်သည် ။ Math.method(number)


ဂဏန်းမှ ကိန်းပြည့်

ဂဏန်းတစ်ခုကို ကိန်းပြည့်တစ်ခုသို့ ပတ်ရန် ဘုံနည်းလမ်း 4 ခုရှိသည်။

သင်္ချာဝိုင်း(x)x သည် ၎င်း၏အနီးဆုံးကိန်းပြည့်သို့ အဝိုင်းသားပြန်ပေးသည်။
Math.ceil(x)x သည် ၎င်း၏ အနီးဆုံးကိန်းပြည့်သို့ ဝိုင်းထားသည်။
Math.floor(x)x သည် ၎င်း၏အနီးဆုံးကိန်းပြည့်သို့ အဝိုင်းချုံ့ထားသည်။
Math.trunc(x)x ၏ ကိန်းပြည့်အပိုင်းကို ပြန်ပေးသည် ( ES6 တွင် အသစ် )

Math.round()

Math.round(x) အနီးဆုံးကိန်းပြည့်ကို ပြန်ပေးသည်-

ဥပမာများ

Math.round(4.6);
Math.round(4.5);
Math.round(4.4);

Math.ceil()

Math.ceil(x)အနီးဆုံးကိန်းပြည့်သို့ ဝိုင်း ထားသော x တန်ဖိုးကို ပြန်ပေးသည် -

ဥပမာ

Math.ceil(4.9);
Math.ceil(4.7);
Math.ceil(4.4);
Math.ceil(4.2);
Math.ceil(-4.2);

Math.floor()

Math.floor(x)x ၏တန်ဖိုးကို ၎င်း၏အနီးဆုံးကိန်းပြည့်သို့ ပြန်ပေး သည်-

ဥပမာ

Math.floor(4.9);
Math.floor(4.7);
Math.floor(4.4);
Math.floor(4.2);
Math.floor(-4.2);

Math.trunc()

Math.trunc(x) x ၏ ကိန်းပြည့်ကို ပြန်ပေးသည်-

ဥပမာ

Math.trunc(4.9);
Math.trunc(4.7);
Math.trunc(4.4);
Math.trunc(4.2);
Math.trunc(-4.2);

Math.sign()

Math.sign(x) x သည် အနှုတ်၊ null သို့မဟုတ် positive ဖြစ်ပါက ပြန်ပေးသည်-

ဥပမာ

Math.sign(-4);
Math.sign(0);
Math.sign(4);

Math.trunc() နှင့် Math.sign() ကို JavaScript 2015 - ES6 တွင် ထည့်သွင်းခဲ့သည် ။



Math.pow()

Math.pow(x, y) x တန်ဖိုးကို y ၏ ပါဝါသို့ ပြန်ပေးသည်-

ဥပမာ

Math.pow(8, 2);

Math.sqrt()

Math.sqrt(x) x ၏ နှစ်ထပ်ကိန်းကို ပြန်ပေးသည်-

ဥပမာ

Math.sqrt(64);

Math.abs()

Math.abs(x) x ၏ အကြွင်းမဲ့ (အပြုသဘော) တန်ဖိုးကို ပြန်ပေးသည်။

ဥပမာ

Math.abs(-4.7);

Math.sin()

Math.sin(x) ထောင့် x (ရေဒီယံဖြင့်ပေးသည်) ၏ sine (-1 နှင့် 1 အကြားတန်ဖိုး) ကို ပြန်ပေးသည်။

အကယ်၍ သင်သည် radian အစား ဒီဂရီကို အသုံးပြုလိုပါက၊ သင်သည် ဒီဂရီကို radian သို့ ပြောင်းရပါမည်-

ရေဒီယံရှိ ထောင့် = ဒီဂရီ x PI / 180 ထောင့်။

ဥပမာ

Math.sin(90 * Math.PI / 180);     // returns 1 (the sine of 90 degrees)

Math.cos()

Math.cos(x) ထောင့် x (ရေဒီယံဖြင့်ပေးသည်) ၏ -1 နှင့် 1 ကြားတန်ဖိုးကို cosine ကို ပြန်ပေးသည်။

အကယ်၍ သင်သည် radian အစား ဒီဂရီကို အသုံးပြုလိုပါက၊ သင်သည် ဒီဂရီကို radian သို့ ပြောင်းရပါမည်-

ရေဒီယံရှိ ထောင့် = ဒီဂရီ x PI / 180 ထောင့်။

ဥပမာ

Math.cos(0 * Math.PI / 180);     // returns 1 (the cos of 0 degrees)

Math.min() နှင့် Math.max()

Math.min()ငြင်း ခုံ Math.max()မှုများစာရင်းတွင် အနိမ့်ဆုံး သို့မဟုတ် အမြင့်ဆုံးတန်ဖိုးကို ရှာဖွေရန် အသုံးပြုနိုင်သည်။

ဥပမာ

Math.min(0, 150, 30, 20, -8, -200);

ဥပမာ

Math.max(0, 150, 30, 20, -8, -200);

Math.random()

Math.random() 0 (ပါဝင်) နှင့် 1 (သီးသန့်) အကြား ကျပန်းနံပါတ်ကို ပြန်ပေးသည်-

ဥပမာ

Math.random();

Math.random()ဤသင်ခန်းစာ၏ နောက်အခန်းတွင် သင်အကြောင်းပိုမိုလေ့လာနိုင်ပါမည် ။


Math.log() နည်းလမ်း

Math.log(x)x ၏ သဘာဝ လော့ဂရစ်သမ်ကို ပြန်ပေးသည်။

သဘာဝ လော့ဂရစ်သမ် သည် ကြီးထွားမှု အဆင့်သို့ ရောက်ရန် လိုအပ်သော အချိန်ကို ပြန်ပေးသည်-

ဥပမာများ

Math.log(1);
Math.log(2);
Math.log(3);

Math.E နှင့် Math.log() တို့သည် အမွှာများဖြစ်သည်။

10 ရဖို့ Math.E ကို ဘယ်နှစ်ခါမြှောက်ရမလဲ။

Math.log(10);

Math.log2() နည်းလမ်း

Math.log2(x)x ၏ အခြေခံ 2 လော့ဂရစ်သမ်ကို ပြန်ပေးသည်။

8 ရဖို့ 2 ကို ဘယ်နှစ်ခါ မြှောက်ရမလဲ။

Math.log2(8);

Math.log10() နည်းလမ်း

Math.log10(x)x ၏ အခြေခံ 10 လော့ဂရစ်သမ်ကို ပြန်ပေးသည်။

1000 ရဖို့ 10 ကို ဘယ်နှစ်ခါ မြှောက်ရမှာလဲ။

Math.log10(1000);

JavaScript သင်္ချာနည်းလမ်းများ

Method Description
abs(x) Returns the absolute value of x
acos(x) Returns the arccosine of x, in radians
acosh(x) Returns the hyperbolic arccosine of x
asin(x) Returns the arcsine of x, in radians
asinh(x) Returns the hyperbolic arcsine of x
atan(x) Returns the arctangent of x as a numeric value between -PI/2 and PI/2 radians
atan2(y, x) Returns the arctangent of the quotient of its arguments
atanh(x) Returns the hyperbolic arctangent of x
cbrt(x) Returns the cubic root of x
ceil(x) Returns x, rounded upwards to the nearest integer
cos(x) Returns the cosine of x (x is in radians)
cosh(x) Returns the hyperbolic cosine of x
exp(x) Returns the value of Ex
floor(x) Returns x, rounded downwards to the nearest integer
log(x) Returns the natural logarithm (base E) of x
max(x, y, z, ..., n) Returns the number with the highest value
min(x, y, z, ..., n) Returns the number with the lowest value
pow(x, y) Returns the value of x to the power of y
random() Returns a random number between 0 and 1
round(x) Rounds x to the nearest integer
sign(x) Returns if x is negative, null or positive (-1, 0, 1)
sin(x) Returns the sine of x (x is in radians)
sinh(x) Returns the hyperbolic sine of x
sqrt(x) Returns the square root of x
tan(x) Returns the tangent of an angle
tanh(x) Returns the hyperbolic tangent of a number
trunc(x) Returns the integer part of a number (x)

သင်္ချာရည်ညွှန်းချက်အပြည့်အစုံ

ပြီးပြည့်စုံသော အကိုးအကားအတွက်၊ ကျွန်ုပ်တို့၏ ပြီးပြည့်စုံသော သင်္ချာဆိုင်ရာ အ ကိုးအကားသို့ သွားပါ ။

ကိုးကားချက်တွင် သင်္ချာဂုဏ်သတ္တိများနှင့် နည်းလမ်းအားလုံး၏ ဖော်ပြချက်များနှင့် ဥပမာများ ပါရှိသည်။

လေ့ကျင့်ခန်းများဖြင့် သင့်ကိုယ်သင် စမ်းသပ်ပါ။

လေ့ကျင့်ခန်း

ကျပန်းနံပါတ်တစ်ခုဖန်တီးရန် မှန်ကန်သောသင်္ချာနည်းလမ်းကို အသုံးပြုပါ။

let r = ;