var
fun1 =
function
() {
document.write(
'Hello World!<br />'
);
}
fun2 =
fact(n) {
if
(n>1) {
return
n * fact(n-1);
else
{
1;
var fun1 = function() { document.write('Hello World!'); } var fun2 = function fact(n) { if(n>1) { return n * fact(n-1); } else { return 1; } }
<!DOCTYPE html>
<
html
>
head
meta
charset
=
"utf-8"
/>
title
>New Page</
script
src
"js/script.js"
></
</
body
fun1();
document.write('factorial of number 5 = ' + fun2(5));