Created
February 21, 2017 16:28
-
-
Save Olgagr/d0209a9693225671d48a31c996ced600 to your computer and use it in GitHub Desktop.
Zadania
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Zadanie 1 | |
var fullname = 'John Doe'; | |
var obj = { | |
fullname: 'Colin Ihrig', | |
prop: { | |
fullname: 'Aurelio De Rosa', | |
getFullname: function() { | |
return this.fullname; | |
} | |
} | |
}; | |
console.log(obj.prop.getFullname()); // ? | |
var test = obj.prop.getFullname; | |
console.log(test()); // ? | |
// Zadanie 2 | |
function test() { | |
console.log(a); | |
console.log(foo()); | |
var a = 1; | |
function foo() { | |
return 2; | |
} | |
} | |
test(); | |
// Zadanie 3 | |
function Person(){}; | |
var person = Person(); | |
var person = new Person(); | |
// Zadanie 4 | |
add(2)(5); | |
// Zadanie 5 | |
(function() { | |
var a = b = 5; | |
})(); | |
console.log(b); | |
// Zadanie 6 | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<!-- critical-styling.css - base styles, critical for page --> | |
<link rel="stylesheet" href="critical-styling.css"> | |
<!-- app styling --> | |
<link rel="stylesheet" href="base.css"> | |
<link rel="stylesheet" href="layout.css"> | |
<link rel="stylesheet" href="componenents.css"> | |
<link rel="stylesheet" href="print.css" media="print"> | |
<script src="app.js"></script> | |
<script src="some-analytics-script.js"></script> | |
</head> | |
<body> | |
</body> | |
</html> | |
// Zadanie 7 | |
// Zaimplementuj klasę/obiekt Widget. Przy utworzeniu przyjmuje ona wysokość i szerokość oraz Node element ($elem) oraz metodę render. Metoda render przyjmuje jako argument Node, do którego należy wstawić $elem. | |
// Następnie zaimplementuj obiekt/klasę Button, który "dziedziczy" po Widget, ale dodatkowo przy inicjalizacji można podać mu label oraz przy render można mu podpiąć event na 'click' i podać callback jaki ma się wywołać. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment