javascript engine know the type of variables through their values:
<script>
var x=5.01; //x if float
var x="abc"; //x is string
var x=true; //x is Boolean
</script>
but here:
<script>
var loadFile = function(event) {
var image = document.getElementById('output');
image.src = URL.createObjectURL(event.target.files[0]);
}
</script>
My question is:
how come event ( passed as a function parameter ) is known as event object without explicit or implicit expression to define it???
what makes it an event object and not other type like float integer..??
Notice: here where fileLoad is called:
<input type=file id=profilepic accept="image/*" name=profilepic onchange="loadFile(event)">