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
let users = [ | |
{id: 1, name: 'user1', status: 'online'}, | |
{id: 2, name: 'user2', status: 'offline'}, | |
{id: 3, name: 'user3', status: 'invisible'} | |
] | |
let updatedUser = {id: 4, name: 'user2', status: 'lalala'} | |
let index = -1; | |
let oldItems = users; | |
let newItems = []; |
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
function fib3(value){ | |
if(value === 1) return 1 | |
if(value === 2) return 1 | |
if(value > 2) { | |
return fib3(value - 1 ) + fib3(value - 2) | |
} | |
} | |
let t0 = performance.now(); | |
result = fib3(30); | |
let t1 = performance.now(); |
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
var App = Backbone.View.extend({ | |
el: $('#app'), | |
popapStatus: 'hidden', | |
initialize: function() { | |
var popapView = new PopapView(), | |
buttonView = new ButtonView(); |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
</head> | |
<body> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> | |
</script> | |
<script src="http://documentcloud.github.com/underscore/underscore-min.js"> |
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
var someClass = function(){ | |
function init(){ | |
console.log('someClass is created') | |
} | |
this.init = init; | |
} | |
var myclock = new someClass(); | |
myclock.init(); |
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
$(window).load(function() { | |
var countArray = [100,54,13] | |
var counter = 0 | |
$('.social-likes__counter').not(".social-likes__counter_twitter").each(function(){ | |
var num = $(this).text() | |
var num2 = parseInt(num) + countArray[counter] | |
$(this).text(num2) | |
counter++ | |
}) | |
}) |