疑難雜症萬事通
在網路上遇到任何問題都可以在這邊找找看唷

Search

js call js function 在 紀老師程式教學網 Facebook 的最佳解答

  • Share this:

[好文推薦] 30 天學會 JavaScript!免費!全中文喔!

文章連結:https://goo.gl/UN7EBZ

--------(本文開始)--------

今天推薦的是由「IT 邦幫忙」網站的一個系列文:「I Want to Know JS」。它用 30 + 2 篇幅,很完整地介紹了 JavaScript。如果想學 JavaScript 的朋友,不妨閱讀看看!

前面的 30 篇,分別是介紹 JavaScript 的正文。分別是:

01. Why Do I Want To Know JS
02. JavaScript - 原始型別概述
03. JavaScript - Built-In Objects 概述
04. JavaScript - 原始型別個別介紹
05. JavaScript - 物件 與 屬性
06. JavaScript - 變數
07. JavaScript - 參數傳遞方式 (1)
08. JavaScript - 參數傳遞方式 (2)
09. JavaScript - Function
10. JavaScript - Lexical Scope
11. JavaScript - Scope 單位 & 查找
12. JavaScript - Hoisting
13. JavaScript - Closure (1)
14. JavaScript - Closure (2)
15. JavaScript - Scope 實作建議
16. JavaScript - call,apply,bind
17. JavaScript - This (1)
18. JavaScript - This (2)
19. JavaScript - This Priority
20. JavaScript - 物件導向 (1)
21. JavaScript - 物件導向 (2) - 建立共用函式
22. JavaScript 物件導向 (3) - 繼承原型方法
23. JavaScript 物件導向 (4) - With ES6
24. JavaScript - Prototype Chain
25. JavaScript - Coding Style (1)
26. JavaScript - Coding Style (2)
27. JavaScript - 非同步執行
28. JavaScript - Promise (1)
29. JavaScript - Promise (2)
30. I Want To Know JS - 結語

後面有兩篇關於「屬性描述器(Property Descriptor)」補充:

1. JavaScript - 屬性描述器 (1)
2. JavaScript - 屬性描述器 (2)

相信整個系列讀下來,應該對各位 JavaScript 的功力進步很有幫助才是!

希望大家喜歡今天的分享!請大家多多按讚鼓勵、或追蹤我的 FB、YouTube、以及 Instagram 喔~

---------------

Facebook 粉絲頁(歡迎追蹤): https://goo.gl/N1z9JB
YouTube 頻道(歡迎訂閱): https://goo.gl/pQsdCt
Instagram 日常生活: https://goo.gl/nBHzXC



About author

由紀老師每天瀏覽 500+ 國內外「程式設計」文章後,挑出真正有用的文章,分享在此!堅持不貼「問安文」與「生活照」的園地(笑)。
View all posts

js call js function 在 紀老師程式教學網 Facebook 的精選貼文

  • Share this:


[好文推薦] 30 天學會 JavaScript!免費!全中文喔!

文章連結:https://goo.gl/UN7EBZ

-\-\-\-\-\-\-\-\(本文開始)-\-\-\-\-\-\-\-\

今天推薦的是由「IT 邦幫忙」網站的一個系列文:「I Want to Know JS」。它用 30 + 2 篇幅,很完整地介紹了 JavaScript。如果想學 JavaScript 的朋友,不妨閱讀看看!

前面的 30 篇,分別是介紹 JavaScript 的正文。分別是:

01. Why Do I Want To Know JS
02. JavaScript - 原始型別概述
03. JavaScript - Built-In Objects 概述
04. JavaScript - 原始型別個別介紹
05. JavaScript - 物件 與 屬性
06. JavaScript - 變數
07. JavaScript - 參數傳遞方式 (1)
08. JavaScript - 參數傳遞方式 (2)
09. JavaScript - Function
10. JavaScript - Lexical Scope
11. JavaScript - Scope 單位 & 查找
12. JavaScript - Hoisting
13. JavaScript - Closure (1)
14. JavaScript - Closure (2)
15. JavaScript - Scope 實作建議
16. JavaScript - call,apply,bind
17. JavaScript - This (1)
18. JavaScript - This (2)
19. JavaScript - This Priority
20. JavaScript - 物件導向 (1)
21. JavaScript - 物件導向 (2) - 建立共用函式
22. JavaScript 物件導向 (3) - 繼承原型方法
23. JavaScript 物件導向 (4) - With ES6
24. JavaScript - Prototype Chain
25. JavaScript - Coding Style (1)
26. JavaScript - Coding Style (2)
27. JavaScript - 非同步執行
28. JavaScript - Promise (1)
29. JavaScript - Promise (2)
30. I Want To Know JS - 結語

後面有兩篇關於「屬性描述器(Property Descriptor)」補充:

1. JavaScript - 屬性描述器 (1)
2. JavaScript - 屬性描述器 (2)

相信整個系列讀下來,應該對各位 JavaScript 的功力進步很有幫助才是!

希望大家喜歡今天的分享!請大家多多按讚鼓勵、或追蹤我的 FB、YouTube、以及 Instagram 喔~

-\-\-\-\-\-\-\-\-\-\-\-\-\-\-

Facebook 粉絲頁(歡迎追蹤): https://goo.gl/N1z9JB
YouTube 頻道(歡迎訂閱): https://goo.gl/pQsdCt
Instagram 日常生活: https://goo.gl/nBHzXC



About author

由紀老師每天瀏覽 500+ 國內外「程式設計」文章後,挑出真正有用的文章,分享在此!堅持不貼「問安文」與「生活照」的園地(笑)。
View all posts

js call js function 在 Taipei Ethereum Meetup Facebook 的最讚貼文

  • Share this:


📜 [專欄新文章] Solidity Weekly #11
✍️ mingderwang
📥 歡迎投稿: https://medium.com/taipei-ethereum-meetup #徵技術分享文 #使用心得 #教學文 #medium

pure 跟 view 怎麼用?

在 Solidity 0.4.16 (含)之前,modifier constant 表示該 function 不會動到合約的 state (狀態), 例如:

string greeting;

function SayHello() public constant returns(string says) { return greeting;}

greeting 在 constructor 或其他地方, 已經有值,在這 SayHello() function 裡並沒有更動到 greeting 的值 (也就是合約的狀態)。

更正確的講,如果一個 function 不會改變到合約的 state,就可以加 modifier constant 在 returns 前面,因此在 web3.js 就可以用 call() 來呼叫該 function, 而不需要用 sendTransaction() 來呼叫。

到了 solc 0.4.17, 更把 constant 細分為 view 或 pure 兩種,只是程度上的不同。

view 一般來說,就用來取代 constant, 跟 compiler 説,該 function 不會對 storage state 有任何變動。(但會進行讀取, 所以 constant 改名為 view,更為恰當)

string greeting;

function SayHello() public view returns(string says) { return greeting;}

pure 定義該 function 連讀 storage state 都沒有。有人舉了一個誇張的例子如下:(它跟合約的所有 states 都無關, 可以加 modifier pure)

function returnTrue() public pure returns(bool response) { return true;}

links 分享;

Plasma Cash Simple Spec — (Karl Floersch)

Plasma Cash Initial Release — Plasma-Backed NFTs Now Available on Loom Network Sidechains — (Matthew Campbell)

https://github.com/loomnetwork/plasma-cash

https://github.com/omisego/plasma-cash

後記;

那麼有用 view 或 pure 有什麼好處?當然有了,以後 solc 最佳化, 可以因沒有 transaction, 而不需花 gas。現在這類的 function 也不必花時間到 network 去做確認造成 delay,也可以靠 compiler 檢查,避免 state 被意外修改。所以該加 view 或 pure 就要加。

*view 和 pure 取代 constant 開始於 solidity ^0.4.17

Solidity Weekly #11 was originally published in Taipei Ethereum Meetup on Medium, where people are continuing the conversation by highlighting and responding to this story.

👏 歡迎轉載分享鼓掌



About author

We have regular meeting twice per month on discussing blockchain technology, smart contracts and DApps development! We would love to have you join us!
View all posts

js call js function 在 コバにゃんチャンネル Youtube 的最佳解答

  • Share this:


post-title

About author
コバにゃん☆です?
View all posts

js call js function 在 大象中醫 Youtube 的最讚貼文

  • Share this:


post-title

About author
長照是一個劇變的旋轉舞台 百年難得一見 沒有準備的人 被旋轉舞台甩出去 不是坐下就是躺下 而大象中醫是太極的推手 推動著旋轉舞台 讓 所有爬不起來的人 背後有一股推手力量 支撐再站起來
View all posts

js call js function 在 大象中醫 Youtube 的精選貼文

  • Share this:


post-title

About author
長照是一個劇變的旋轉舞台 百年難得一見 沒有準備的人 被旋轉舞台甩出去 不是坐下就是躺下 而大象中醫是太極的推手 推動著旋轉舞台 讓 所有爬不起來的人 背後有一股推手力量 支撐再站起來
View all posts
社群媒體上有些相關的討論:

js call js function 在 JavaScript call() Method and Its Practical Applications 的推薦與評價

Introduction to the JavaScript call() method ... The call() method calls a function functionName with a given this value and arguments. The first argument of the ... ... <看更多>

js call js function 在 JS Function Methods call( ), apply( ), and bind( ) - YouTube 的推薦與評價

影片讀取中

JS Function Methods call( ), apply( ), and bind( ) ... Functions all share three methods - call( ), apply ... ... <看更多>