JavaScript
- 17 ответов
- 0 вопросов
7
Вклад в тег
var canvas = document.getElementById('canvas'),
context = canvas.getContext("2d");
context.fillRect(50, 50, 90, 50)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<canvas id="canvas"></canvas>
<script>
var canvas = document.getElementById('canvas'),
context = canvas.getContext("2d");
context.fillRect(50, 50, 90, 50)
</script>
</body>
</html>
var human = (function (person) {
this.person = {
firstName : "John",
lastName : "Doe",
age : person.age || 50,
eyeColor : person.eyeColor || "blue",
};
this.getInfo = function () {return person.age + ", " + person.eyeColor; }
return this;
});
var getPerson = new human({ eyeColor: "Yellow" });
//
console.log(getPerson.person, getPerson.getInfo());