In your BetterString example, how do we know which includes function we are accessing? In the examples before that you call Js.String and Js.String2. Which is being used in BetterString?
If you look up [@bs.send] in the Bucklescript docs , you see that it can be used for object methods such as Array.prototype.map() or String.prototype.includes(). Thus, that is all you need for using the internal JS methods on all available JS prototypes.
In your
BetterString
example, how do we know whichincludes
function we are accessing? In the examples before that you callJs.String
andJs.String2
. Which is being used inBetterString
?Thanks for sharing this post. Very useful.
If you look up
[@bs.send]
in the Bucklescript docs , you see that it can be used for object methods such asArray.prototype.map()
orString.prototype.includes()
. Thus, that is all you need for using the internal JS methods on all available JS prototypes.Check out how it works in Reason Try!
Many thanks for your feedback!
Danka, sir. Also missed this link github.com/moroshko/bs-blabla at the bottom of those docs. Thanks for sending me back there.