_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 27 233k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q8700 | queryWorksheet | train | async function queryWorksheet(workSheetInfo, query, options) {
var key = util.createIdentifier(
workSheetInfo.worksheetId,
JSON.stringify(query)
);
options = options || {};
options.query = query;
| javascript | {
"resource": ""
} |
q8701 | deleteEntries | train | async function deleteEntries(worksheetInfo, entityIds) {
entityIds.reverse();
// since google pushes up the removed row, the ID will change to the previous
// avoiding this iterate through the collection in reverse order
// TODO: needs performance improvement
var response;
for (let id of enti... | javascript | {
"resource": ""
} |
q8702 | queryFields | train | async function queryFields(workSheetInfo) {
var key = util.createIdentifier(
'queryFields',
workSheetInfo.worksheetId
);
return await fetchData(
| javascript | {
"resource": ""
} |
q8703 | createXMLWriter | train | function createXMLWriter(extended) {
extended = extended || false;
var xw = new XmlWriter().startElement('entry')
.writeAttribute('xmlns', 'http://www.w3.org/2005/Atom');
return extended ?
xw.writeAttribute(
'xmlns:gsx',
| javascript | {
"resource": ""
} |
q8704 | queryRequest | train | function queryRequest(queryOptions) {
if (!queryOptions) {
return;
}
var options = util._extend({}, queryOptions);
if (options.query && options.query.length) {
options.query = '&sq=' + encodeURIComponent(options.query);
}
if (options.sort) {
options.orderBy = '&orderb... | javascript | {
"resource": ""
} |
q8705 | worksheetData | train | function worksheetData(worksheet) {
return {
worksheetId: getItemIdFromUrl(g(worksheet.id)),
title: g(worksheet.title),
updated: g(worksheet.updated),
| javascript | {
"resource": ""
} |
q8706 | worksheetEntry | train | function worksheetEntry(entry, fieldPrefix) {
fieldPrefix = fieldPrefix || 'gsx$';
var data = {
'_id': getItemIdFromUrl(g(entry.id)),
'_updated': g(entry.updated)
};
Object.keys(entry)
.filter(function(key) {
return ~key.indexOf(fieldPrefix) && g(entry[key], true);
... | javascript | {
"resource": ""
} |
q8707 | sheetInfoResponse | train | function sheetInfoResponse(rawData) {
var feed = rawData.feed;
return {
title: g(feed.title),
updated: g(feed.updated),
workSheets: feed.entry.map(worksheetData),
| javascript | {
"resource": ""
} |
q8708 | workSheetInfoResponse | train | function workSheetInfoResponse(rawData) {
if (typeof rawData === 'string') {
| javascript | {
"resource": ""
} |
q8709 | queryResponse | train | function queryResponse(rawData) {
var entry = rawData.feed.entry | javascript | {
"resource": ""
} |
q8710 | queryFieldNames | train | function queryFieldNames(rawData) {
var entry = rawData.feed.entry || [];
return entry.map(function(item) {
var field = worksheetEntry(item, 'gs$');
| javascript | {
"resource": ""
} |
q8711 | createWorksheetRequest | train | function createWorksheetRequest(options) {
options = options || {};
// TODO: needs to handle overflow cases and create ore dynamically
var rowCount = util.coerceNumber(options.rowCount || 5000);
var colCount = util.coerceNumber(options.colCount || 50);
options.rowCount = Math.max(rowCount, 10);
... | javascript | {
"resource": ""
} |
q8712 | createEntryRequest | train | function createEntryRequest(entry) {
var xw = createXMLWriter(true);
Object.keys(entry).forEach(function(key) {
xw = xw.startElement('gsx:' + key)
| javascript | {
"resource": ""
} |
q8713 | updateEntryRequest | train | function updateEntryRequest(entry) {
var xw = createXMLWriter(true);
Object.keys(entry)
.filter(function(key) {
// filter out internal properties
return key.indexOf('_') !== 0;
})
.forEach(function(key) {
| javascript | {
"resource": ""
} |
q8714 | createFieldRequest | train | function createFieldRequest(columnName, position) {
if (util.isNaN(position) || position <= 0) {
throw new TypeError('Position should be a number which is higher than one!');
}
var xw = createXMLWriter();
xw = xw.startElement('gs:cell')
.writeAttribute('row', 1)
| javascript | {
"resource": ""
} |
q8715 | chunk | train | function chunk(iterable, size=1) {
let current = 0
if (_.isEmpty(iterable)) {
return iterable
}
let result | javascript | {
"resource": ""
} |
q8716 | difference | train | function difference(iterable, values) {
const valueSet = Set(values)
| javascript | {
"resource": ""
} |
q8717 | fill | train | function fill(iterable, value, start=0, end=iterable.size) {
let num = end - start | javascript | {
"resource": ""
} |
q8718 | intersection | train | function intersection(...iterables) {
if (_.isEmpty(iterables)) return OrderedSet()
let result = OrderedSet(iterables[0])
for (let iterable of | javascript | {
"resource": ""
} |
q8719 | sample | train | function sample(iterable) {
let index = lodash.random(0, iterable.size - | javascript | {
"resource": ""
} |
q8720 | sampleSize | train | function sampleSize(iterable, n=1) {
let index = -1
let result = List(iterable)
const length = result.size
const lastIndex = length - 1
while (++index < n) {
const rand = lodash.random(index, lastIndex)
const value | javascript | {
"resource": ""
} |
q8721 | at | train | function at(map, paths) {
return paths.map((path) | javascript | {
"resource": ""
} |
q8722 | defaults | train | function defaults(map, ...sources) {
return map.mergeWith((prev, next) => {
return prev | javascript | {
"resource": ""
} |
q8723 | defaultsDeep | train | function defaultsDeep(map, ...sources) {
return map.mergeDeepWith((prev, next) => {
return prev | javascript | {
"resource": ""
} |
q8724 | pick | train | function pick(map, props) {
props = Set(props)
return _.pickBy(map, | javascript | {
"resource": ""
} |
q8725 | coerceNumber | train | function coerceNumber(value) {
if (typeof value === 'number') {
return value;
}
let isfloat = /^\d*(\.|,)\d*$/;
| javascript | {
"resource": ""
} |
q8726 | coerceDate | train | function coerceDate(value) {
if (value instanceof Date) {
return value;
}
| javascript | {
"resource": ""
} |
q8727 | coerceValue | train | function coerceValue(value) {
let numValue = coerceNumber(value);
if (numValue === value) {
| javascript | {
"resource": ""
} |
q8728 | getArrayFields | train | function getArrayFields(array) {
return (array || []).reduce((old, current) => {
arrayDiff(Object.keys(current), old)
| javascript | {
"resource": ""
} |
q8729 | arrayDiff | train | function arrayDiff(arrayTarget, arrayCheck) {
if (!(arrayTarget instanceof Array) || !(arrayCheck instanceof Array)) {
throw new Error('Both objects have to be an | javascript | {
"resource": ""
} |
q8730 | copyMetaProperties | train | function copyMetaProperties(dest, source) {
if (!dest || !source) {
return dest;
}
let fields = ['_id', '_updated'];
| javascript | {
"resource": ""
} |
q8731 | renderSASS | train | function renderSASS(input, output) {
var d = Q.defer();
sass.render({
file: input
}, function (e, out) {
if (e) return d.reject(e);
| javascript | {
"resource": ""
} |
q8732 | train | function() {
var book = this;
var styles = book.config.get('styles');
return _.reduce(styles, function(prev, filename, type) {
return prev.then(function() {
var extension = path.extname(filename).toLowerCase();
if (extension !... | javascript | {
"resource": ""
} | |
q8733 | _keyPathNormalize | train | function _keyPathNormalize(kp) {
return new String(kp).replace(/\[([^\[\]]+)\]/g, function(m, k) {
| javascript | {
"resource": ""
} |
q8734 | _set | train | function _set(obj, keypath, value, hook) {
var parts = _keyPathNormalize(keypath).split('.')
var last = parts.pop()
var dest = obj
parts.forEach(function(key) {
// Still set to non-object, just throw that error
dest = dest[key]
})
| javascript | {
"resource": ""
} |
q8735 | _get | train | function _get(obj, keypath) {
var parts = _keyPathNormalize(keypath).split('.')
var dest = obj
parts.forEach(function(key) {
if (isNon(dest)) | javascript | {
"resource": ""
} |
q8736 | _join | train | function _join(pre, tail) {
var _hasBegin = !!pre
if(!_hasBegin) pre = ''
if (/^\[.*\]$/.exec(tail)) return pre + tail
else if (typeof(tail) == 'number') return pre + '[' + | javascript | {
"resource": ""
} |
q8737 | listToFragment | train | function listToFragment(list) {
var fragment = document.createDocumentFragment();
for (var i = 0, l = list.length; i < l; i++) {
// Use toFragment since this may be an array of text, a jQuery object of `<template>`s, etc.
fragment.appendChild(toFragment(list[i]));
if | javascript | {
"resource": ""
} |
q8738 | train | function(string) {
if (!string) {
var fragment = document.createDocumentFragment();
fragment.appendChild(document.createTextNode(''));
| javascript | {
"resource": ""
} | |
q8739 | createFile | train | function createFile() {
let fileContent = '';
/*
* Customize data by type
*/
switch (options.type) {
case 'js':
fileContent += `'use strict';` + '\n';
for (let collectionKey in _variableCollection) {
fileContent += `const ${colle... | javascript | {
"resource": ""
} |
q8740 | propertyMatch | train | function propertyMatch(property) {
for (let count = 0; count < options.match.length; count++) {
if (property.indexOf(options.match[count]) > -1) { | javascript | {
"resource": ""
} |
q8741 | extractVariables | train | function extractVariables(value) {
let regex = [/var\((.*?)\)/g, /\$([a-zA-Z0-9_\-]*)/g ],
result = [],
matchResult;
regex.forEach(expression => {
while (matchResult = expression.exec(value)) {
| javascript | {
"resource": ""
} |
q8742 | resolveReferences | train | function resolveReferences() {
for (let key in _variableCollection) {
let referenceVariables = extractVariables(_variableCollection[key]);
for (let current = 0; current < referenceVariables.length; current++) {
if (_.isEmpty(_variableCollection[_.camelCase(referenceVar... | javascript | {
"resource": ""
} |
q8743 | escapeValue | train | function escapeValue(value) {
switch (options.type) {
case 'js':
return value.replace(/'/g, '\\\'');
case 'json':
| javascript | {
"resource": ""
} |
q8744 | convertToTokens | train | function convertToTokens( contents, filterParams ) {
var tokens = marked.lexer( contents );
// Simple case: no filtering needs to happen
if ( ! filterParams ) {
// Return the array of tokens from this content
return tokens;
}
/**
* Filter method to check whether a token is valid, based on the pro... | javascript | {
"resource": ""
} |
q8745 | isTokenValid | train | function isTokenValid( token ) {
/**
* Reducer function to check token validity: start the token out as valid,
* then reduce through the provided filter parameters, updating the validity
* of the token after checking each value.
*
* @param {Boolean} valid Reducer function memo ... | javascript | {
"resource": ""
} |
q8746 | tokenizeMarkdownFromFiles | train | function tokenizeMarkdownFromFiles( files, filterParams ) {
/**
* Read in the provided file and return its contents as markdown tokens
*
* @param {String} file A file path to read in
* @return {Array} An array of the individual markdown tokens found
* within the provided li... | javascript | {
"resource": ""
} |
q8747 | readAndTokenize | train | function readAndTokenize( file ) {
// Read the file
var fileContents = grunt.file.read( file );
// Map file into an object defining the tokens for this file
return { | javascript | {
"resource": ""
} |
q8748 | MuxFactory | train | function MuxFactory(options) {
function Class (receiveProps) {
Ctor.call(this, options, receiveProps)
}
| javascript | {
"resource": ""
} |
q8749 | _defPrivateProperty | train | function _defPrivateProperty(name, value) {
if (instanceOf(value, Function)) value = value.bind(model)
_privateProperties[name] = value
| javascript | {
"resource": ""
} |
q8750 | _emitChange | train | function _emitChange(propname/*, arg1, ..., argX*/) {
var args = arguments
var kp = $normalize($join(_rootPath(), propname))
args[0] = CHANGE_EVENT + | javascript | {
"resource": ""
} |
q8751 | _prop2CptDepsMapping | train | function _prop2CptDepsMapping (propname, dep) {
// if ($indexOf(_computedKeys, dep))
// return $warn('Dependency should not computed property')
$util.patch(_cptDepsMapping, dep, [])
| javascript | {
"resource": ""
} |
q8752 | _subInstance | train | function _subInstance (target, props, kp) {
var ins
var _mux = target.__mux__
if (_mux && _mux.__kp__ === kp && _mux.__root__ === __muxid__) {
// reuse
ins = target
// emitter proxy
ins._$emitter(emitter)
// a private emitter for commu... | javascript | {
"resource": ""
} |
q8753 | _walk | train | function _walk (name, value, mountedPath) {
var tov = $type(value) // type of value
// initial path prefix is root path
var kp = mountedPath ? mountedPath : $join(_rootPath(), name)
/**
* Array methods hook
*/
if (tov == ARRAY) {
$arrayHook(value, f... | javascript | {
"resource": ""
} |
q8754 | _$set | train | function _$set(kp, value, lazyEmit) {
if (_destroy) return _destroyNotice()
return _$sync(kp, value, lazyEmit)
// if (!diff) return
/**
* Base type change of object type will be trigger change event
* next and pre value are not keypath value but property value
... | javascript | {
"resource": ""
} |
q8755 | _$setMulti | train | function _$setMulti(keyMap) {
if (_destroy) return _destroyNotice()
if (!keyMap || $type(keyMap) != OBJECT) return
var changes = []
$util.objEach(keyMap, function (key, item) {
var cg = _$set(key, item, true)
| javascript | {
"resource": ""
} |
q8756 | _$add | train | function _$add(prop, value, lazyEmit) {
if (prop.match(/[\.\[\]]/)) {
throw new Error('Propname shoudn\'t contains "." or "[" or "]"')
}
if ($indexOf(_observableKeys, prop)) {
// If value is specified, reset value
return arguments.length > 1 ? true : false
... | javascript | {
"resource": ""
} |
q8757 | _walkResetEmiter | train | function _walkResetEmiter (ins, em, _pem) {
if ($type(ins) == OBJECT) {
var items = ins
if (instanceOf(ins, Mux)) {
ins._$emitter(em, _pem)
items = ins.$props()
}
$util.objEach(items, function (k, v) {
| javascript | {
"resource": ""
} |
q8758 | train | function (apiBaseUrl, apiKey, projectId) {
this.config = {
apiBaseUrl: apiBaseUrl,
| javascript | {
"resource": ""
} | |
q8759 | connect | train | function connect(sheetId, options) {
options = options || {};
// TODO: needs better access token handling
let api = apiFactory.getApi(options.version);
let restClient = clientFactory({
token: options.token, | javascript | {
"resource": ""
} |
q8760 | train | function(node, callback) {
if (node.firstViewNode) | javascript | {
"resource": ""
} | |
q8761 | polylinearScale | train | function polylinearScale (domain, range, clamp) {
const domains = domain || [0, 1]
const ranges = range || [0, 1]
clamp = clamp || false
if (domains.length !== ranges.length) {
throw new Error('polylinearScale requires domain and range to have an equivalent number of values')
}
/**
* The compiled s... | javascript | {
"resource": ""
} |
q8762 | inherit | train | function inherit(inheritor, inherited) {
inheritor.prototype = Object.create(inherited.prototype);
| javascript | {
"resource": ""
} |
q8763 | rename | train | function rename(cls, name) {
try {
Object.defineProperty(cls, "name", { value: name });
}
catch (ex) {
// Trying to defineProperty on `name` fails on Safari with a TypeError.
| javascript | {
"resource": ""
} |
q8764 | makeError | train | function makeError(jqXHR, textStatus, errorThrown, options) {
var Constructor = statusToError[textStatus];
// We did not find anything in the map, which would happen if the textStatus
| javascript | {
"resource": ""
} |
q8765 | connectionCheck | train | function connectionCheck(error, diagnose) {
var servers = diagnose.knownServers;
// Nothing to check so we fail immediately.
if (!servers || servers.length === 0) {
throw new ServerDownError(error);
}
// We check all the servers that the user asked to check. If none respond,
// we blame ... | javascript | {
"resource": ""
} |
q8766 | diagnoseIt | train | function diagnoseIt(error, diagnose) {
// The browser reports being offline, blame the problem on this.
if (("onLine" in navigator) && !navigator.onLine) {
throw new BrowserOfflineError(error);
}
var serverURL = diagnose.serverURL;
var check;
// If the user gave us a server URL to check w... | javascript | {
"resource": ""
} |
q8767 | isNetworkIssue | train | function isNetworkIssue(error) {
// We don't want to retry when a HTTP error occurred.
return !(error instanceof errors.HttpError) &&
| javascript | {
"resource": ""
} |
q8768 | doit | train | function doit(originalArgs, originalSettings, jqOptions, bjOptions) {
var xhr;
var p = new Promise(function resolver(resolve, reject) {
xhr = bluetry.perform.call(this, originalSettings, jqOptions, bjOptions);
function succeded(data, textStatus, jqXHR) {
resolve(bjOptions.verboseResults ? [d... | javascript | {
"resource": ""
} |
q8769 | _ajax$ | train | function _ajax$(url, settings, override) {
// We just need to split up the arguments and pass them to ``doit``.
var originalArgs = settings ? [url, settings] : [url];
var originalSettings = settings || url;
| javascript | {
"resource": ""
} |
q8770 | init | train | function init(config) {
// the given config is only applied if no config has been set already (stored as localConfig)
if (Object.keys(localConfig).length === 0) {
if (config.hasOwnProperty("logging") && (config.logging.constructor === {}.constructor)) {
// config has "logging" key with an {}... | javascript | {
"resource": ""
} |
q8771 | trueOrMatch | train | function trueOrMatch(needle, haystack) {
if (needle === true) {
return true;
}
if (_.isRegExp(needle) && needle.test(haystack)) {
return true;
}
if (_.isString(needle) && haystack.indexOf(needle) !== -1) {
return true;
}
if | javascript | {
"resource": ""
} |
q8772 | splitIniLine | train | function splitIniLine(line) {
var separator = line.indexOf('=');
if (separator === -1) {
return [line];
}
return [
| javascript | {
"resource": ""
} |
q8773 | ini2json | train | function ini2json(iniData) {
var result = {};
var iniLines = iniData.toString().split('\n');
var context = null;
for (var i in iniLines) {
var fields = splitIniLine(iniLines[i]);
for (var j in fields) {
fields[j] = fields[j].trim();
}
if (fields[0].length) {
if (fields[0].indexOf('['... | javascript | {
"resource": ""
} |
q8774 | splitCsvLine | train | function splitCsvLine(line) {
if (!line.trim().length) {
return [];
}
var fields = [];
var inQuotes = false;
var separator = 0;
for (var i = 0; i < line.length; i++) {
switch(line[i]) {
case "\"":
if (i>0 && line[i-1] != "\\") {
inQuotes = !inQuotes;
}
break;
... | javascript | {
"resource": ""
} |
q8775 | csv2json | train | function csv2json(csvData) {
var result = {};
var csvLines = csvData.toString().split('\n');
for (var i in csvLines) {
var fields = splitCsvLine(csvLines[i]);
if (fields.length) {
var key = '';
for (var k = 0; k < fields.length - 1; k++) {
| javascript | {
"resource": ""
} |
q8776 | load | train | function load(options) {
if (cache[options.locales]) {
options.verbose && gutil.log('Skip loading cached translations from', options.locales);
return dictionaries = cache[options.locales];
}
try {
options.verbose && gutil.log('Loading translations from', options.locales);
var files = fs.readdirSyn... | javascript | {
"resource": ""
} |
q8777 | isBinary | train | function isBinary(buffer) {
var chunk = buffer.toString('utf8', 0, Math.min(buffer.length, 24));
for (var i in chunk) {
var charCode = chunk.charCodeAt(i);
if | javascript | {
"resource": ""
} |
q8778 | replace | train | function replace(file, options) {
var contents = file.contents;
var copied = 0;
var processed = translate(options, contents, copied, file.path);
var files = [];
for (var lang in processed) {
var params = {};
params.ext = path.extname(file.path).substr(1);
params.name = path.basename(file.path, p... | javascript | {
"resource": ""
} |
q8779 | findAndReplace | train | function findAndReplace(target, find, replaceWith, config) {
if (config === void 0) { config = { onlyPlainObjects: false }; }
if ((config.onlyPlainObjects === false && !isAnyObject(target)) ||
(config.onlyPlainObjects === true && !isPlainObject(target))) {
if (target === find)
r... | javascript | {
"resource": ""
} |
q8780 | findAndReplaceIf | train | function findAndReplaceIf(target, checkFn) {
if (!isPlainObject(target))
return checkFn(target);
return Object.keys(target)
.reduce(function (carry, key) {
| javascript | {
"resource": ""
} |
q8781 | train | function ( e ) {
// Default context is `this` element
var context = (selector ? matchElement( e.target, selector, true ) : this);
// Handle `mouseenter` and `mouseleave`
if ( event === "mouseenter" || event === "mouseleave" ) {
| javascript | {
"resource": ""
} | |
q8782 | binaryOperator | train | function binaryOperator(queryObject, actualField, key) {
return actualField + OPS[key] | javascript | {
"resource": ""
} |
q8783 | logicalOperator | train | function logicalOperator(queryObject, actualField, key) {
let textQuery = '(';
for (let i = 0; i < queryObject.length; i++) {
textQuery += (i > 0 | javascript | {
"resource": ""
} |
q8784 | updateObject | train | function updateObject(entities, descriptor) {
if (!entities) {
return entities;
}
let result = Array.isArray(entities) ? entities : [entities];
if (!isUpdateDescriptor(descriptor)) {
return descriptor && typeof descriptor === 'object'
? [util.copyMetaProperties(descriptor,... | javascript | {
"resource": ""
} |
q8785 | mutate | train | function mutate(entities, operationDescription, transformation) {
if (!operationDescription) {
return object;
}
return entities.map(item => {
Object.keys(operationDescription) | javascript | {
"resource": ""
} |
q8786 | isUpdateDescriptor | train | function isUpdateDescriptor(descriptor) {
if (typeof descriptor !== 'object' || !descriptor) {
return false;
} | javascript | {
"resource": ""
} |
q8787 | train | function(doc) {
if (!doc) {
doc = document;
}
if (doc === document && this.pool.length) {
return this.pool.pop();
}
| javascript | {
"resource": ""
} | |
q8788 | computeWeight | train | function computeWeight(i) {
if(dead[i]) {
return Infinity
}
//TODO: Check that the line segment doesn't cross once simplified | javascript | {
"resource": ""
} |
q8789 | heapDown | train | function heapDown(i) {
var w = heapWeight(i)
while(true) {
var tw = w
var left = 2*i + 1
var right = 2*(i + 1)
var next = i
if(left < heapCount) {
var lw = heapWeight(left)
if(lw < tw) {
next = left
tw = lw
}
}
if(right < hea... | javascript | {
"resource": ""
} |
q8790 | heapUp | train | function heapUp(i) {
var w = heapWeight(i)
while(i > 0) {
var parent = heapParent(i)
if(parent >= 0) {
var pw = heapWeight(parent)
if(w < pw) {
| javascript | {
"resource": ""
} |
q8791 | heapUpdate | train | function heapUpdate(i, w) {
var a = heap[i]
if(weights[a] === w) {
return i
}
weights[a] = -Infinity
heapUp(i)
| javascript | {
"resource": ""
} |
q8792 | getComputedCSS | train | function getComputedCSS(styleName) {
if (this.ownerDocument.defaultView && this.ownerDocument.defaultView.opener) {
| javascript | {
"resource": ""
} |
q8793 | animateElement | train | function animateElement(css, options) {
var playback = { onfinish: null };
if (!Array.isArray(css) || css.length !== 2 || !options || !options.hasOwnProperty('duration')) {
Promise.resolve().then(function() {
if (playback.onfinish) {
playback.onfinish();
}
});
return playback;
}
... | javascript | {
"resource": ""
} |
q8794 | capitalize | train | function capitalize(str) {
let result = str.trim();
| javascript | {
"resource": ""
} |
q8795 | getWithLength | train | function getWithLength(length) {
var arrays = pool[length];
var array;
var i;
// Create the first array for the specified length
if (!arrays) {
array = create(length);
}
// Find an unused array among the created arrays for the specified length
if (!array) {
for (i = arrays.length; i--;) {
... | javascript | {
"resource": ""
} |
q8796 | giveBack | train | function giveBack(array) {
// Don't return arrays that didn't originate from this pool
if (!array.hasOwnProperty('originalLength')) return;
// Reset all the elements
for (var i = array.length; i--;) { | javascript | {
"resource": ""
} |
q8797 | create | train | function create(length) {
var array = new Array(length);
// Create a non-enumerable property as a flag to know if the array is in use
Object.defineProperties(array, {
inUse: {
enumerable: false,
writable: true,
value: false
}, | javascript | {
"resource": ""
} |
q8798 | Typpy | train | function Typpy(input, target) {
if (arguments.length === 2) {
| javascript | {
"resource": ""
} |
q8799 | bind | train | function bind(scope, method) {
var args = slice.call(arguments, 2)
if (typeof method === 'string') {
method = scope[method]
}
if (!method) {
throw new Error('Proxy: method `' + | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.