From novice to JAVA SCRIPT for all
Rapid Javascript Training (Pluralsight) :-
https://jsfiddle.net/hanumesh/sqmb4o5b/1/
1) var total = 5.1 + 3.3
console.log (total);
output :-
8.399999999999999
========================================================================
http://javascriptissexy.com/oop-in-javascript-what-you-need-to-know/
Various ways to create an object:-
1) ubiquitous object literal pattern :-
var myObj = {name: "Richard", profession: "Developer"};
2) You can use the prototype pattern, adding each method and property directly on the object’s prototype :-
function Employee() {
Employee.prototype.firstName = "Hanumesh";
};
var hanu = new Employee()
console.log (hanu.firstName);
3) You can also use the constructor pattern, a constructor function (Classes in other languages, but Functions in JavaScript).
function Employee1(name, age) {
this.name = name;
this.age = age;
};
var hanu = new Employee1("Hanumesh", "27")
console.log (hanu.name, hanu.age);
====================================================================
Encapsulation in JavaScript :-
Mozilla developer Javascript :-
http://geekswithblogs.net/shaunxu/archive/2013/12/12/bind-call-and-apply-in-javascript-function.aspx
With "bind()" method, we can set the context of a function. So in the future we can invoke this function variant without specifying the context when invoked.
By using "bind" we can set any object as the context of a function. This gives us extremely flexibility to extend our code. I
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide
1) JavaScript is a dynamically typed language. That means you don't have to specify the data type of a variable when you declare it, and data types are converted automatically as needed during script execution
2) Falsy values
5) http://www.w3schools.com/js/js_object_definition.asp
6) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model
http://kenwheeler.github.io/slick/
7) Event Bubbling :-
https://javascript.info/tutorial/bubbling-and-capturing
8) Closures :-
Closures are functions, that 'remember' the environment in which they were created.
9) http://stackoverflow.com/questions/15455009/javascript-call-apply-vs-bind
OOJ:-
https://jsfiddle.net/hanumesh/sqmb4o5b/1/
1) var total = 5.1 + 3.3
console.log (total);
output :-
8.399999999999999
========================================================================
http://javascriptissexy.com/oop-in-javascript-what-you-need-to-know/
Various ways to create an object:-
1) ubiquitous object literal pattern :-
var myObj = {name: "Richard", profession: "Developer"};
2) You can use the prototype pattern, adding each method and property directly on the object’s prototype :-
function Employee() {
Employee.prototype.firstName = "Hanumesh";
};
var hanu = new Employee()
console.log (hanu.firstName);
3) You can also use the constructor pattern, a constructor function (Classes in other languages, but Functions in JavaScript).
function Employee1(name, age) {
this.name = name;
this.age = age;
};
var hanu = new Employee1("Hanumesh", "27")
console.log (hanu.name, hanu.age);
====================================================================
Encapsulation in JavaScript :-
function User (theName, theEmail) {
|
Mozilla developer Javascript :-
http://geekswithblogs.net/shaunxu/archive/2013/12/12/bind-call-and-apply-in-javascript-function.aspx
With "bind()" method, we can set the context of a function. So in the future we can invoke this function variant without specifying the context when invoked.
By using "bind" we can set any object as the context of a function. This gives us extremely flexibility to extend our code. I
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide
1) JavaScript is a dynamically typed language. That means you don't have to specify the data type of a variable when you declare it, and data types are converted automatically as needed during script execution
2) Falsy values
The following values evaluate to false (also known as Falsy values):
false
undefined
null
0
NaN
- the empty string (
""
)
var shallowCopy = fruits.slice(); // this is how to make a copy
// ["Strawberry"]
4) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array5) http://www.w3schools.com/js/js_object_definition.asp
6) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model
http://kenwheeler.github.io/slick/
7) Event Bubbling :-
https://javascript.info/tutorial/bubbling-and-capturing
8) Closures :-
Closures are functions, that 'remember' the environment in which they were created.
9) http://stackoverflow.com/questions/15455009/javascript-call-apply-vs-bind
OOJ:-
Comments
Post a Comment