Alert code and Function code in javascript

Is neccessary to add ALERT code in javascript after using FUNCTION code to know that code is working or not?If we do not want to type the alert code and if I want to know that my code is working or not means for example I typed:-

function pi(){
return 3.14;
function area_circle®{
return area
So for this code where can I see my answer(output) without using ALERT code in javascript?

return area, this command will… Execute the area will be printed on screen… And u’ll get to know that our code… Is working

Thanks for replying.

It is not necessary to se “alert” at the end of javascript functions . “Alert” is an inbuilt javascript function used to display some message as an alert in a box . If you want to know whether your code is working or not …Use typeof operator to know about the function existence before calling , Use return statements to return the function value.