Skip to content

Instantly share code, notes, and snippets.

View VoloshchenkoAl's full-sized avatar
🇺🇦

Alex VoloshchenkoAl

🇺🇦
View GitHub Profile
function countHolders(array, placeholder) {
var length = array.length,
result = 0;
while (length--) {
if (array[length] === placeholder) {
++result;
}
}
return result;
<div class="wrap">
<input type="checkbox" name="slide1" class="none" id="slide1" />
<label for="slide1">показати</label>
<p class="show">some text here</p>
</div>
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require('path');
const bundleFolder = './entry/';
const fs = require('fs');
const testFiles = /\.js$/;
const arrayFiles = fs.readdirSync(bundleFolder);
const AssetsPlugin = require('assets-webpack-plugin');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const objEntry = arrayFiles.reduce(function (result, item) {
function isPrime(value) {
if (!isPrime.answers) {
isPrime.answers = {};
}
if (isPrime.answers[value] !== null) {
return isPrime.answers[value];
}
var prime = value != 1;
console.log(a(1))
function a(foo) {
if( foo > 20 ) return foo;
return b(foo+2);
}
function b(foo) {
return c(foo) + 1;
}
var Line = (function () {
function Line(line) {
this.x = line.x;
this.y = line.y;
this.id = line.id;
}
Line.prototype.setX = function (x) {
this.x = x;
};
Line.prototype.setY = function (y) {
function map$viaReduce (array, fn)
{
return array.reduce(function (memo, item, index, array)
{
return memo.concat([ fn(item, index, array) ]);
}, []);
};
blah.addEventListener('touchend', function(e) {
/* prevent delay and simulated mouse events */
e.preventDefault();
/* trigger the actual behavior we bound to the 'click' event */
e.target.click();
})
blah.addEventListener('click', function() {
/* actual functionality */
});
var findNodes = function (callback) {
var i = 100000,
nodes = [],
found;
// проверить, является ли объект callback функцией
if (typeof callback !== “function”) {
callback = false;
}
while (i) {
i -= 1;
_workWithDOM:{
_empty: function( parent ) {
while (parent.firstChild) {
parent.removeChild(parent.firstChild);
}
},
_removeClass: function( el, className ) {
if( el.classList ) {
el.classList.remove( className );