JavaScript函數索引

來源:互聯網
上載者:User
關鍵字: javascript函數索引 math string date
本文轉載自 http://www.dreamdu.com/javascript/functions_reference/

JavaScript函數索引

JavaScript Math 對象與函數
JavaScript String 對象與函數
JavaScript Date 對象與函數

JavaScript Math 對象與函數

Math函數
Js代碼

1. * Math.abs() -- 返回數位絕對值
2. * Math.acos() -- 返回數位反餘弦值
3. * Math.asin() -- 返回數位反正弦值
4. * Math.atan() -- 返回數位反正切值
5. * Math.atan2() -- 返回由x軸到點(x,y)的角度(以弧度為單位)
6. * Math.ceil() -- 返回大於等於數字參數的最小整數(取整函數),對數字進行上舍入
7. * Math.cos() -- 返回數位餘弦值
8. * Math.exp() -- 返回E(自然對數的底數)的x次冪(指數)
9. * Math.floor() -- 返回小於等於數字參數的最大整數,對數字進行下舍入
10. * Math.log() -- 返回數位自然對數
11. * Math.max() -- 返回數個數字中較大的值
12. * Math.min() -- 返回數個數字中較小的值
13. * Math.pow() -- 返回底數的指定次冪
14. * Math.random() -- 返回0和1之間的偽隨機數
15. * Math.round() -- 返回數字最接近的整數,四捨五入
16. * Math.sin() -- 返回數位正弦值
17. * Math.sqrt() -- 返回數位平方根
18. * Math.tan() -- 返回數位正切值
19.
20. Math屬性
21.
22. * Math.E 屬性 -- 返回自然對數的底數,E約等於2.718
23. * Math.LN2 屬性 -- 返回2的自然對數loge2,約等於0.693
24. * Math.LN10 屬性 -- 返回10的自然對數loge2,約等於2.302
25. * Math.LOG2E 屬性 -- 返回以2為底的E的對數log2e,約等於1.442
26. * Math.LOG10E 屬性 -- 返回以10為底的E的對數log10e,越等於0.434
27. * Math.PI 屬性 -- 返回圓的周長與其直徑的比值(圓周率π),約等於3.1415926
28. * Math.SQRT1_2 屬性 -- 返回0.5的平方根,或2的平方根除1,約等於0.707
29. * Math.SQRT2 屬性 -- 返回2的平方根,約等於1.414

* Math.abs() -- 返回數位絕對值
* Math.acos() -- 返回數位反餘弦值
* Math.asin() -- 返回數位反正弦值
* Math.atan() -- 返回數位反正切值
* Math.atan2() -- 返回由x軸到點(x,y)的角度(以弧度為單位)
* Math.ceil() -- 返回大於等於數字參數的最小整數(取整函數),對數字進行上舍入
* Math.cos() -- 返回數位餘弦值
* Math.exp() -- 返回E(自然對數的底數)的x次冪(指數)
* Math.floor() -- 返回小於等於數字參數的最大整數,對數字進行下舍入
* Math.log() -- 返回數位自然對數
* Math.max() -- 返回數個數字中較大的值
* Math.min() -- 返回數個數字中較小的值
* Math.pow() -- 返回底數的指定次冪
* Math.random() -- 返回0和1之間的偽隨機數
* Math.round() -- 返回數字最接近的整數,四捨五入
* Math.sin() -- 返回數位正弦值
* Math.sqrt() -- 返回數位平方根
* Math.tan() -- 返回數位正切值

Math屬性

* Math.E 屬性 -- 返回自然對數的底數,E約等於2.718
* Math.LN2 屬性 -- 返回2的自然對數loge2,約等於0.693
* Math.LN10 屬性 -- 返回10的自然對數loge2,約等於2.302
* Math.LOG2E 屬性 -- 返回以2為底的E的對數log2e,約等於1.442
* Math.LOG10E 屬性 -- 返回以10為底的E的對數log10e,越等於0.434
* Math.PI 屬性 -- 返回圓的周長與其直徑的比值(圓周率π),約等於3.1415926
* Math.SQRT1_2 屬性 -- 返回0.5的平方根,或2的平方根除1,約等於0.707
* Math.SQRT2 屬性 -- 返回2的平方根,約等於1.414

JavaScript String 對象與函數

Js代碼

1. * anchor() 函數 -- 返回HTML a 標籤中name屬性為str的錨
2. * big() 函數 -- 返回HTML big 標籤定義的大字型
3. * blink() 函數 -- 返回使用HTML blink 標籤定義的閃爍字串
4. * bold() 函數 -- 返回使用HTML b 標籤定義的粗體字串
5. * charAt() 函數 -- 返回指定位置(n)的字元
6. * charCodeAt() 函數 -- 返回指定位置(n)字元的Unicode編碼
7. * concat() 函數 -- 合并多個字串,並返回合并的結果
8. * fixed() 函數 -- 返回使用HTML tt 標籤定義的單間距字串
9. * fontcolor() 函數 -- 返回使用HTML font 標籤中color屬性定義的帶有顏色的字串
10. * fontsize() 函數 -- 返回使用HTML font 標籤中size屬性定義的指定尺寸的字串
11. * fromCharCode() 函數 -- 返回多個Unicode程式碼群組成的字串
12. * indexOf() 函數 -- 返回substring在string中的位置
13. * italics() 函數 -- 返回使用HTML i 標籤定義的斜體字串
14. * lastIndexOf() 函數 -- 返回substring在string中最後匹配(出現)的位置
15. * link() 函數 -- 返回使用HTML a 標籤定義的連結
16. * localeCompare() 函數 -- 使用本地規則比較字串string與string2,並返回比較結果
17. * replace() 函數 -- 將字串string中的oldStr1替換為newStr2
18. * slice() 函數 -- 返回被截取的字串
19. * small() 函數 -- 返回使用HTML small 標籤定義的小字型的字串
20. * split() 函數 -- 將字串分割為字串數組,並返回此數組
21. * strike() 函數 -- 返回使用HTML strike 標籤定義刪除線樣式的字串
22. * sub() 函數 -- 返回使用HTML sub 標籤定義的下標字串
23. * substr() 函數 -- 返回從string的startPos位置,長度為length的字串
24. * substring() 函數 -- 返回從string的startPos位置,到endPos位置的字串
25. * sup() 函數 -- 返回使用HTML sup 標籤定義的上標字串
26. * toLocaleLowerCase() 函數 -- 返回本地小寫字串
27. * toLocaleUpperCase() 函數 -- 返回本地大寫字串
28. * toLowerCase() 函數 -- 返回小寫字串
29. * toUpperCase() 函數 -- 返回大寫字串

* anchor() 函數 -- 返回HTML a 標籤中name屬性為str的錨
* big() 函數 -- 返回HTML big 標籤定義的大字型
* blink() 函數 -- 返回使用HTML blink 標籤定義的閃爍字串
* bold() 函數 -- 返回使用HTML b 標籤定義的粗體字串
* charAt() 函數 -- 返回指定位置(n)的字元
* charCodeAt() 函數 -- 返回指定位置(n)字元的Unicode編碼
* concat() 函數 -- 合并多個字串,並返回合并的結果
* fixed() 函數 -- 返回使用HTML tt 標籤定義的單間距字串
* fontcolor() 函數 -- 返回使用HTML font 標籤中color屬性定義的帶有顏色的字串
* fontsize() 函數 -- 返回使用HTML font 標籤中size屬性定義的指定尺寸的字串
* fromCharCode() 函數 -- 返回多個Unicode程式碼群組成的字串
* indexOf() 函數 -- 返回substring在string中的位置
* italics() 函數 -- 返回使用HTML i 標籤定義的斜體字串
* lastIndexOf() 函數 -- 返回substring在string中最後匹配(出現)的位置
* link() 函數 -- 返回使用HTML a 標籤定義的連結
* localeCompare() 函數 -- 使用本地規則比較字串string與string2,並返回比較結果
* replace() 函數 -- 將字串string中的oldStr1替換為newStr2
* slice() 函數 -- 返回被截取的字串
* small() 函數 -- 返回使用HTML small 標籤定義的小字型的字串
* split() 函數 -- 將字串分割為字串數組,並返回此數組
* strike() 函數 -- 返回使用HTML strike 標籤定義刪除線樣式的字串
* sub() 函數 -- 返回使用HTML sub 標籤定義的下標字串
* substr() 函數 -- 返回從string的startPos位置,長度為length的字串
* substring() 函數 -- 返回從string的startPos位置,到endPos位置的字串
* sup() 函數 -- 返回使用HTML sup 標籤定義的上標字串
* toLocaleLowerCase() 函數 -- 返回本地小寫字串
* toLocaleUpperCase() 函數 -- 返回本地大寫字串
* toLowerCase() 函數 -- 返回小寫字串
* toUpperCase() 函數 -- 返回大寫字串

JavaScript Date 對象與函數
Js代碼

1. * Date() 函數 -- 返回當前的日期與時間
2. * getDate() 函數 -- 返回date對象中的月份中的天數(1-31)
3. * getDay()函數 -- 返回date對象中的星期中的天數(0-6)
4. * getFullYear() 函數 -- 返回date對象中的四位元年份
5. * getHours()函數 -- 返回date對象中的小時數(0-23)
6. * getMilliseconds() 函數 -- 返回date對象中的毫秒數(0-999)
7. * getMinutes() 函數 -- 返回date對象中的分鐘數(0-59)
8. * getMonth() 函數 -- 返回date對象中的月份數(0-11)
9. * getSeconds() 函數 -- 返回date對象中的秒數(0-59)
10. * getTime() 函數 -- 返回date對象的時間戳記標記法(毫秒錶示)
11. * getTimezoneOffset() 函數 -- 返回本地時間與用UTC表示當前日期的時間差,以分鐘為單位
12. * getUTCDate() 函數 -- 返回date對象中用世界標準時間(UTC)表示的月份中的一天(1-31)
13. * getUTCDay() 函數 -- 返回date對象中用世界標準時間(UTC)表示的周中的一天(0-6)
14. * getUTCFullYear() 函數 -- 返回date對象中用世界標準時間(UTC)表示的四位年份
15. * getUTCHours() 函數 -- 返回date對象中用世界標準時間(UTC)表示的小時數(0-23)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.