<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Call, Apply and Bind - JS</title>
</head>
<body>
<h3>Call, Apply and Bind</h3>
<h4>Please view browser console.</h4>
<span id="time_now"></span>
<script type="text/javascript">
function sum(name, dep)
{
var c = this.a + this.b;
console.log(name + ' : ' + dep + ' : ' + c);
}
var obj = {a:55, b:67};
sum.call(obj, 'Ramasamy K', 'CSE');
sum.apply(obj, ['Kali K', 'EEE']);
var raj = sum.bind(obj, 'Raj S', 'ECE');
raj();
</script>
</body>
</html>
Thursday, May 11, 2017
Learn Javascript - Call, Apply and Bind - 15
Subscribe to:
Post Comments (Atom)
Learn JavaScript - String and its methods - 16
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>String and it's methods - JS...
-
1. Get JQuery Cookie library in hand To implement this first you need to have JQuery Cookie library. So please save following JS file a...
-
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>String and it's methods - JS...
-
To check a record exist on table use below code, $exist = User::find()->where(['email' => $email])->exists(); if($exis...
No comments:
Post a Comment