With language like JS it's really easy to write something like:
var a = 5;
console.log(a + ' times\n');
how can I write the same code with erlang?
With language like JS it's really easy to write something like:
var a = 5;
console.log(a + ' times\n');
how can I write the same code with erlang?
If your question is about stringification of any Erlang term, there is ~p
in io:format/2,3
function.
A = 5, io:format("~p times~n", [A]).
If you are interested in debugging output, there is also erlang:display/1
function. It works like io:format("~p~n", [X]), true.
.