make Callback function and check if it is undefine in javascript

<!DOCTYPE html>

<html>
<script>
window.onload = hello;

function hello(){
test(function aaa(){
alert('callback success');
});

test();
}

function test(callback){
if(typeof callback  != 'undefined'){

callback();
}
}
</script>

</html>

Comments

Popular posts from this blog

Project euler 169 found clue

Floyd-Warshall's algorithm