I'm new to javascript and having a little trouble understanding functions.
I need write a function that will receive a single numeric value, square the value and return the value for use. Name the function myUsefulFunction
.
I got this far but now cant figure how to square the value
var aNumber = 18;
function myUsefulFunction(x){
return aNumber = aNumber/x;
}
var amendedValue = doubleNumber(2);
console.log(amendedValue);
Any help would be greatly appreciated.