Ports are Elms method of getting data into and out of your program via Javascript. As long as the data you want to move around can be simply converted to json, it will work over a port.
Read the full guide on ports for more examples.
port module Core exposing (..) import --… port dealOne : (Bool -> msg) -> Sub msg port sendToJs : Int -> Cmd msg main = Html.program { init = init , update = update , view = view , subscriptions = (\model -> dealOne DealOneCardMsg) }
<script> core = Elm.Core.embed(/*…*/) core.ports.dealOne.send(true); core.ports.sendToJs.subscribe(function (val) { console.log(val); }); </script>