Friday 5 July 2019

javascript: define a variable in a function

In PHP I can do something like this:



public myFunction($variable=0) {
//Do some stuff
}



In Javascript, the following does not work:



var myFunction = function(variable=0 )
{

//do some stuff...

};

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...