blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
132
path
stringlengths
3
236
src_encoding
stringclasses
29 values
length_bytes
int64
8
7.94M
score
float64
2.52
5.72
int_score
int64
3
5
detected_licenses
listlengths
0
142
license_type
stringclasses
2 values
text
stringlengths
8
7.94M
download_success
bool
1 class
6212770630c9e255e8e01952848ea0b341adaa96
JavaScript
goldironhack/IH-Project-2018-5adfa262c2bee800145a994d_webapp_phase1
/index.js
UTF-8
2,167
2.640625
3
[]
no_license
var map; var iniMap={lat:40.7291,lng:-73.9965}; const api_key="AIzaSyAzpOBqITSBf9XFZTm1OuSdU1KRqtJmCgw"; const Neighborhood_Names_GIS="https://data.cityofnewyork.us/api/views/xyye-rtrs/rows.json?accessType=DOWNLOAD"; var infoRows = []; var JDistric = $.get(Neighborhood_Names_GIS) //<!-- Funcion para crear el ma...
true
27082d2170f09ab99c3cc13a08c015828d01f52b
JavaScript
postcert/CookbookMeanStack
/server/models/Cookbook.js
UTF-8
1,610
2.703125
3
[]
no_license
var mongoose = require('mongoose'); var minRating = [0, 'The value of field `{PATH}` ({VALUE}) lower than the limit ({MIN}).']; var maxRating = [5, 'The value of field `{PATH}` ({VALUE}) exceeds the limit ({MAX}).']; var cookbookSchema = mongoose.Schema({ title: {type: String, required:'{PATH} is required', uniqu...
true
3ead35a762caae89f96620087840389219424cbc
JavaScript
macalada/reactPractice
/hello-react/src/components/LifecycleA.js
UTF-8
1,203
2.625
3
[]
no_license
import React, { Component } from 'react' import LifecycleB from './LifecycleB' class LifecycleA extends Component { constructor(props) { super(props) this.state = { name:'Bebana' } console.log("A constructor") } static getDerivedStateFromProps(props,state){...
true
779688c6e437b5aeb5a3948c675b69f0f8ad41da
JavaScript
tsmasuda/finanzieren
/src/main/webapp/resources/js/input.js
UTF-8
160
2.765625
3
[]
no_license
function showLength(str) { var bufsize = 256 - str.value.length; document.getElementById("noteinfo").innerHTML = "あと" + bufsize + "文字入力可能"; }
true
6be12d7995c6afa0152fdf07a0bc30d031d8f71e
JavaScript
NathanWaterman/Stock-Market-React-Demo
/src/components/login/Login.js
UTF-8
4,935
2.5625
3
[]
no_license
import React, { Component, useState, useEffect } from "react"; import { BrowserRouter as Router, Route } from 'react-router-dom'; import { stockInfo } from "../../api/marketData"; import './login.css'; import ErrorUI from '../Error'; import ValidUser from "../App"; class Login extends Component { state = ...
true
f4bed04e463e30dded80976747307ab6b81d0eb9
JavaScript
daniel12fsp/simple_http_server
/app.js
UTF-8
415
2.90625
3
[]
no_license
/* salvar o arquivo ./app.js */ const http = require("http"); const url = require("url"); const port = process.env.PORT || 3000; const server = http.createServer((req, res) => { res.writeHead(200, { "Content-Type": "text/html" }); res.statusCode = 200; res.write(`<h1>Hello World</h1>${new Date()}`); res.end()...
true
f8204b478e1526f2012d0ec447f651d900dada74
JavaScript
Joetib/gmsa
/static/js/base.js
UTF-8
1,898
2.953125
3
[ "MIT" ]
permissive
function readURL(input, destination) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { destination.innerText = ""; let img = document.createElement("img"); img.src = e.target.result; img.classList.add...
true
41471c1af72d0a72397178bacc7f62e39723c1f7
JavaScript
Odintsov11/loftschool-burgers
/src/js/slider.js
UTF-8
2,026
2.796875
3
[]
no_license
//slider const initSlider = () => { const ENTER_KEY_CODE = 13; const arrows = $('.slider__arrow'); const slider = $('.slider__list'); const sliderItems = slider.find('.slider__item'); const count = sliderItems.length; const defineSlide = () => { const sliderItemActive = sliderItems.filter('.slider__ite...
true
5c2bdcf0873f5a4045a89ff5e200c6026b806217
JavaScript
zhangshuo00/JS-advanced-lessons
/课程练习/ES6迭代器和生成器/0202.js
UTF-8
672
3.515625
4
[]
no_license
/**Promise */ setTimeout(function(){ console.log("world"); },3000); console.log("hello"); /** Promise将异步的操作写成同步执行的方式 * * resolve是异步操作成功时的调用 * reject是异步操作失败时的调用 */ new Promise(function(resolve,reject){ setTimeout(function(){ console.log('world'); resolve(); },3000) }).then(function(){ ...
true
0a00cdb296ee7e945292efa1ddc541d41f9e01dd
JavaScript
ztrabzada1988/omdb-api
/app.js
UTF-8
1,209
3.359375
3
[]
no_license
$(document).ready(function() { // once submit button is clicked, plug the searchItem in url $('#button').on('click', function(event) { event.preventDefault(); // varibale that takes the searched item from submit var searchItem = $('#query').val() // run getRequest function getRequest(searchIte...
true
4833baca344ffb2b3adab99e53eda8efff9547ee
JavaScript
panda-os/media-platform-js-sdk
/src/platform/management/job/source.js
UTF-8
402
2.71875
3
[ "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
permissive
function Source(data) { /** * @type {string} */ this.fileId = null; /** * @type {string} */ this.path = null; if (data) { this.deserialize(data); } } /** * @param data * @private */ Source.prototype.deserialize = function (data) { this.fileId = data.fileId;...
true
8340e2638e9e67a056b3ad41c36748a7f7518cb1
JavaScript
heyannag/Project_2_TLLDL
/encounter_plots.js
UTF-8
1,539
2.65625
3
[]
no_license
function unpack(rows, index) { return rows.map(function(row) { return row[index]; }); }; function getData() { d3.json(/* database/encounters_table */).then(function(data) { var state = unpack(/* state data, index */); var age = unpack(/* age data, index */); var gender = unp...
true
0a662366c1a8892432b2a21af0532706646eca25
JavaScript
KhristinaVasko/KhristinaVasko.github.io
/final/js/script.js
UTF-8
2,558
2.671875
3
[]
no_license
$(document).ready(function(){ //slider $('.slider').slick({ infinite: true, autoplay: true, speed: 500, arrows: false, fade: true, cssEase: 'linear', dots: false, }); // part of code for counting numbers in block 5 $(".counter").counterUp({ delay:10, ...
true
b5c464e3fc434283109cb9b7502e7327b66d0b2f
JavaScript
n0thanks/CS20-Portfolio
/CS20 Projekt/js/main.js
UTF-8
1,103
3.328125
3
[]
no_license
// Reaction Time Project // Global Variables let redButtonEl = document.getElementById("red-circle"); redButtonEl.addEventListener("click", badClick); let startBtnEl = document.getElementById("start-btn"); startBtnEl.addEventListener("click", startTest); let reactionBtnEl = document.getElementById("green-circ...
true
3c27096e1af4a309972ef016ecbfecfa26d484fe
JavaScript
maryhoag/TriviaGame
/assets/javascript/app.js
UTF-8
2,727
3.25
3
[]
no_license
// $(document).ready(function() { var app = { // will these need to be outside the app object? counter: 10, index: 0, wins: 0, losses: 0, questions: [ "What's with the pineapples? It's an inside joke.", "The actor who plays Lassie once played a psychic.", "Every actor from The Breakfast Club has appeared on...
true
7a36c2b608fe4a07daa94ebf52657964219e8cd0
JavaScript
mzulli/misc-js-work
/spyCoder.js
UTF-8
1,419
4.03125
4
[]
no_license
// encode or decode the string // // sample string: ("encode: the big brown bear") // // first word of input will be "encode" or "decode" // // to encode: replace any of the six most common letters in english lang // with the next most common. ie, replace 'e' with 't', 'a' with 'o'. // 'n' gets replaced with 'e'. // /...
true
8e98c77398bffabad7c2037c3f498efdf3788915
JavaScript
sunxing102005/vue_management_system
/vue-express-backstage/websocket/wsServer.js
UTF-8
1,320
2.78125
3
[]
no_license
let webSocketServer = require('websocket').server; let http = require('http'); let server = http.createServer((req,res)=>{ console.log('received request from '+req.url); res.end(); }) server.listen(8090, function() { console.log((new Date()) + ' Server is listening on port 8090'); }); let wsServer = new we...
true
970a542818a1ba328fb2d9d05b4c1e73c1d03273
JavaScript
tranmike270/Liri-CLI
/liri.js
UTF-8
3,876
2.828125
3
[]
no_license
var Spotify = require('node-spotify-api'); var Twitter = require('twitter'); var request = require('request'); require('dotenv').config(); var keys = require('./keys.js'); var fs = require('fs'); var spotify = new Spotify(keys.spotify); var client = new Twitter(keys.twitter); switch(process.argv[2]){ case 'my-t...
true
29d7f3740cd1b4c8edc07f2283a26626b956e69c
JavaScript
howardbdev/javascript-handlebars-templates-lab-v-000
/index.js
UTF-8
4,378
3.953125
4
[ "LicenseRef-scancode-public-domain", "LicenseRef-scancode-unknown-license-reference" ]
permissive
// 1 Create a form template with an id of recipe-form-template that will be used to enter new recipes. Make the form submit with a createRecipe() function. Provide inputs for recipe name, description, and at least five ingredients. Hint: Get comfy collecting values with getElementsByName(). // 2 Create a template with ...
true
8bf52a4b897c94e3efb0bdc83950d05bc2290032
JavaScript
anikonchuk/fleddit-client
/src/actions/postsActions.js
UTF-8
1,833
2.671875
3
[ "MIT" ]
permissive
const BASE_URL = "https://fleddit-api.herokuapp.com" export function fetchAllPosts() { return (dispatch) => { dispatch({type: 'START_ADDING_POSTS'}); return fetch(`${BASE_URL}/api/posts`) .then(response => response.json()) .then(posts => dispatch({type: 'ADD_ALL_POSTS', posts})); }; } export f...
true
85234d856971217c68c740a17721d5d036c4d1a5
JavaScript
pzyu/CAT048
/js/app - Copy.js
UTF-8
16,880
2.828125
3
[]
no_license
const animSpd = 100; // Animation speed in ms var main = function() { var active = $('.tile').first(); var startingPos = $('#grid-12'); active.css({top: startingPos.position().top, left: startingPos.position().left}); active.text(startingPos.attr('id')); startingPos.addClass('taken-tile'); var next = active.nex...
true
cb1f793e460feb0a139222b5b45cd27e65e691e8
JavaScript
alexdmccabe/FFGNDS-Discord-Dice-Roller
/modules/SW.GENESYS/roll.js
UTF-8
7,324
2.609375
3
[ "MIT" ]
permissive
const config = require('../').config; const diceFaces = require('./').diceFaces; const dice = require('../').dice; const emoji = require('../').emoji; const writeData = require('../').writeData; const sleep = require('../').sleep; const order = require('./').order; const symbols = require('./').symbols; const _ = requi...
true
8162fabd174e3f3c2c40b9f1e7ee659772104bf3
JavaScript
paradoxrevolver/polyominosolver
/Vec2.js
UTF-8
2,015
3.84375
4
[ "MIT" ]
permissive
/* A Vec2 is a 2-dimensional vector, a vector with only two values: an X and a Y. */ ps.Vec2 = function (x, y) { let that = this; /* Initalization */ that.init = function (x, y) { // VARIABLES // a 2D vector just stores its x and y that.x = x || 0; that.y = y || 0; /...
true
9a2b8abd151d60d779c018c7e1c6348733471d97
JavaScript
sueddeutsche/json-data-services
/test/State.test.js
UTF-8
2,142
2.8125
3
[]
no_license
/* eslint object-property-newline: 0, max-nested-callbacks: 0 */ const expect = require("chai").expect; const State = require("../lib/state"); describe("state", () => { let state; beforeEach(() => { state = new State(); }); it("should dispatch action", () => { let calledAction; ...
true
ea5682ad7b57f9175240191183050a1529b735f2
JavaScript
itsmepronay/Social-Share-Button
/main.js
UTF-8
1,693
2.71875
3
[]
no_license
/* Social Share Links: WhatsApp: https://wa.me/?text=[post-title] [post-url] Facebook: https://www.facebook.com/sharer.php?u=[post-url] Twitter: https://twitter.com/share?url=[post-url]&text=[post-title] Pinterest: https://pinterest.com/pin/create/bookmarklet/?media=[post-img]&url=[post-url]&is_video=[is_video]&d...
true
d90862995f68ae6505133e578a21026a5c7e3cdf
JavaScript
shaggyrec/telegra.ph-nodejs
/server/lib/quill.js
UTF-8
967
2.75
3
[ "MIT" ]
permissive
function toHtml(data){ let result = '' if(data) { data = typeof data !== 'object' ? JSON.parse(data) : data for (let item in data) { item = data[item] result += `<${item.tag}` if(item.attrs){ for(let attr in item.attrs){ res...
true
59837d7a8ba815a74a958a8081e9b710aff52da5
JavaScript
damoclesgil/Learn-TypeScript-and-JavaScript
/javascript/cursos/curso-javascript-ninja/challenge-15/main2.js
UTF-8
128
2.90625
3
[]
no_license
(function () { function myFunction(arg1, arg2) { return arguments[0]; } console.log(myFunction(1, 2)); })();
true
bfa36caaf6814ea248ddcc371e0d884e0830fdf5
JavaScript
WilfredNtulis/Artist-Search
/public/assets/artist.js
UTF-8
244
2.875
3
[]
no_license
var list = document.querySelectorAll('.list'); list.forEach(function(list){ list.addEventListener('click', function(){ fetch('http://localhost:3000/test') .then(response => response.json()) .then(json => console.log(json)) }) })
true
b7c895019a7b11f59f682ee7b1d090f3801bd5d0
JavaScript
tanujvyas10/Regex-string-generator
/app.js
UTF-8
703
2.9375
3
[]
no_license
const express = require("express"); const Generate = require("./Generator"); const app = express(); app.get("/", (req, res) => { /** * Please change the value n and regexp to check the Generate function */ let n = 10; let regexp = "/[-+]?[0-9]{1,16}[.][0-9]{1,6}/"; //(1[0-2]|0[1-9])(:[0-5][0-9]){2} (A|P)M...
true
495de2a37f9e743127628371e3f1f2c95008107c
JavaScript
zhoukekestar/drafts
/2019-08~12/2019-09-29-typescript/greeter.js
UTF-8
269
3.5625
4
[ "MIT" ]
permissive
function hello(person) { console.log('hi' + person); } function hello2(person) { console.log("hello " + person.firstName + " " + person.lastName); } hello('world'); hello([1, 2, 3]); hello2({ firstName: 'zkk', lastName: 'abc' }); hello2({ firstName: [1, 2] });
true
a528a20e56d7d0a42046c16790d5f2c97254793e
JavaScript
martinperezlouzao/mobile_games_project
/wildPunch/js/SecondPlayer.js
UTF-8
429
2.6875
3
[]
no_license
class SecondPlayer extends Player { constructor(imageSecondPlayer, centreX, centreY) { super(imageSecondPlayer, centreX, centreY); var width = canvas.width, height = canvas.height; this.WIDTH_OF_PLAYER = width/16; this.HEIGHT_OF_PLAYER = height/16; this.centreX = ce...
true
78953bb3a1430840ec03b302bc168b06dfa68c17
JavaScript
Leandro-Da-Souza/nodejs-the-one-where-we-build-a-web-application-assignment-2
/js/main.js
UTF-8
1,085
2.9375
3
[]
no_license
let productPage = document.querySelector('.products ul'); let baseURL = 'http://localhost:8080'; let customerID = 'f6a796d0-3f60-11ea-80cd-8bb22b23e2bf'; let counter = document.querySelector('#counter'); const fetchBasket = async custID => { let response = await fetch(`${baseURL}/getBasket?customerID=${custID}`, {...
true
31eed072f1050a7d17065a645772d86d10423944
JavaScript
Destroyer012/dungeongang
/commands/bot/help.js
UTF-8
4,334
2.75
3
[]
no_license
const Discord = require('discord.js'); const yes = `845121770590961696`; const no = `845121806049869824`; const package = require('../../package.json') module.exports = { name: 'help', aliases: ['h', 'info', `commands`], usage: 'help [command]', description: 'Gets information about the bot', hidd...
true
66e3f623d75b297718219b3a7bbba508b7d6e995
JavaScript
hanjos/bootcamp-solidity-puc
/Investment/test/2_Funds_Investing.js
UTF-8
4,093
2.609375
3
[ "MIT" ]
permissive
var Funds = artifacts.require("./Funds.sol"); assert.bigNumberEqual = function (actual, expected, message) { if(! actual.eq(expected)) { message = (message != undefined) ? message + ": " : ""; throw new AssertionError(message + "expected " + actual.toString() + " to equal " + expected.toString()); } } con...
true
6822676e8773190f3f4eb1aae0a360ff9bbaa5dc
JavaScript
LainaJ/diaboo-frontend
/src/index.js
UTF-8
1,105
3.015625
3
[]
no_license
// import React from 'react'; // import ReactDOM from 'react-dom'; // import './index.css'; // import App from './App'; // import * as serviceWorker from './serviceWorker'; function isPrime(num) { if (num < 2){ return false } for (let i = 2; i <= Math.sqrt(num); i++){ if (num % i === 0) { return fa...
true
e081e577d8c6b2ecd7d3a80823fd81a9d225bc3f
JavaScript
kertron/extjs-demo
/routes/index.js
UTF-8
2,066
2.5625
3
[]
no_license
var Article = require('../models/article.js'); module.exports = function (app) { // 主页 app.get('/', function(req, res){ Article.get(null, function(err, articles){ if(err){ articles = []; } res.render('index', { title : '主页', articles : articles }); }); }...
true
169d43d35ad53dca026786a54510d74c4b480d6c
JavaScript
ojoesuff/ewd-api-labs-2021
/node-lab1/api/movies/index.js
UTF-8
1,243
2.734375
3
[]
no_license
import express from 'express'; import { movies, movieReviews, movieDetails } from './moviesData.js'; import uniqid from 'uniqid' import { notFound } from '../responses/index.js' const router = express.Router(); router.get('/', (req, res) => { res.json(movies); }); // Get movie reviews router.get('/:id/reviews', (...
true
5b996c48b088db1f789ec57ce589fd21b6c1c873
JavaScript
yuanxiaochen1/yidongduan
/js/index.js
UTF-8
2,950
2.546875
3
[]
no_license
let moveimg=function(){ function pageMove() { //=>this:swiperExample let activeIndex = this.activeIndex, slides = this.slides; //=>给当前页面设置ID,让其内容有动画效果 [].forEach.call(slides, (item, index) => { if (index === activeIndex) { activeIndex === ...
true
df3b4e05f4abdcfda773ed7c6a56946c9e0b2e20
JavaScript
egierdian/javascript-firebase
/js/category.js
UTF-8
2,867
2.828125
3
[]
no_license
// Initialize Firebase var config = { apiKey: "AIzaSyB5usrQKua0zDoUMWS-NoMf6wGoihAz4rE", authDomain: "warmat-9d32d.firebaseapp.com", databaseURL: "https://warmat-9d32d.firebaseio.com", projectId: "warmat-9d32d", storageBucket: "warmat-9d32d.appspot.com", messagingSenderId: "124927091557", ...
true
9ce176775be0b5929bc47f6c84d3b631fe9371b5
JavaScript
aditpandey3090/Tree-Visualization-Task-Survey
/surveyed-papers/js/utility.js
UTF-8
2,720
3.15625
3
[]
no_license
$('[data-toggle="tooltip"]').tooltip(); //Create a function that can take entire data, and indexing variable to create a frequency chart function createFrequencyData(data, dimension) { var result = []; data.reduce(function (res, value) { if (!res[value[dimension]]) { res[value[dimension]] = { Id:...
true
2ca52b6980d6968deb2045f03574e4a4de65fdea
JavaScript
GSung95/genesunglao.github.io
/todo/scripts.js
UTF-8
521
3.203125
3
[]
no_license
document.getElementById("mybtn").addEventListener("click", function() { let mycup = document.getElementById("theitem").value; console.log(mycup); if (mycup !== "") { const newBTN = document.createElement("button"); newBTN.innerHTML="\u274C"; const newLI = document.createElement("l...
true
c34842bd742ff20bd679e5c6561ecbdd492f0200
JavaScript
mvolkmann/react-crud
/src/crud/form.js
UTF-8
2,985
2.5625
3
[]
no_license
import {arrayOf, func, object, shape, string} from 'prop-types'; import React, {useState} from 'react'; import './crud.scss'; function Form({cancel, fields, item, save}) { const [newItem, setNewItem] = useState(item); function getInput(field, index) { const {max, min, placeholder, propertyName, type} = field...
true
eb6848383343b6a4525968817129032143633a89
JavaScript
damiencal/webglproject
/shoot.js
UTF-8
3,605
2.953125
3
[ "MIT" ]
permissive
var shootShader; function initShootShader() { shootShader = initShaders("shoot-vs","shoot-fs"); // active ce shader gl.useProgram(shootShader); // recupere la localisation de l'attribut dans lequel on souhaite acceder aux positions shootShader.vertexPositionAttribute = gl.getAttribLocation(shootShad...
true
b09fe16607eab593d431c2e79bb36bcf22c8118c
JavaScript
fullmoon-sg/get-try
/01-edit/index.js
UTF-8
468
2.6875
3
[]
no_license
const axios = require("axios"); async function editMovies(){ let url = "https://ckx-movies-api.herokuapp.com"; let response = await axios.patch(url + "/movie/5fb4c1cab4f44550712da26c",{ title : "Gong Fu", plot : "The lord is in trouble" }) console.log(response.data); } editMovies(); asy...
true
56c44248ca85abe873dded4a8b6a257307239c96
JavaScript
javierj/PickAGem
/src/Gem.js
UTF-8
372
2.859375
3
[]
no_license
function Gem() { } Gem.prototype = new createjs.Bitmap(); Gem.prototype.init = function(gemImg, gemType) { this.initialize(gemImg); this.gemType = gemType; //console.log("Gem::init() image: " + this.image); //this.height = this.image.height; //this.width = this.image.width; } Gem.prototype.isOfType = fu...
true
27fa8c7dd2c83f264d3676455479097cc76fe38d
JavaScript
paigen11/egghead-react-starter
/src/ReactRef.js
UTF-8
1,488
2.84375
3
[]
no_license
import React, {Component} from 'react'; import ReactDOM from 'react-dom'; class ReactRef extends Component { constructor(){ super(); this.state = {a: ''} } // currently, both the a and b fields will be updated regardless of which input is typed in // so remove the event, and set a and ...
true
c99077440e123f637e4a5a0f33188576df4e8706
JavaScript
henriwi/spark-twitter-aws
/src/main/webapp/app.js
UTF-8
501
2.71875
3
[]
no_license
$(function () { var protocol = location.protocol === "https:" ? "wss:" : "ws:"; var ws = new WebSocket(protocol + "//" + location.host + "/ws"); ws.onmessage = function (msg) { var data = JSON.parse(msg.data); render(data) } console.log("ready!"); }); function render(data) { $...
true
eb228b8035d576aa45ed92c6fa5ef1f2ff5abfc1
JavaScript
WaliiidAls/TicTacToe
/script.js
UTF-8
4,917
3.078125
3
[]
no_license
let bg1 = document.getElementsByClassName("bg1"); let bg2 = document.getElementsByClassName("bg2"); let bg3 = document.getElementsByClassName("bg3"); let bg4 = document.getElementsByClassName("bg4"); let bg = [bg1, bg2, bg3, bg4]; function background() { for (let i = 0; i < 4; i++) { let rgba1 = [ Math.floo...
true
d9c5e18fc55ee31f0ed9033593eda31781a7cb93
JavaScript
mjaracz/node-exc
/node/JunggleAsh/3GetReghttps.js
UTF-8
489
2.828125
3
[]
no_license
const http = require('http'); const httpGet = require('./modul-callback.js'); const bl = require('bl'); let count = 0; var arr = []; const get = function(index) { http.get(process.argv[2 + index], (respons) => { respons.pipe(bl((err, data) => { if(err) { console.error(err) } arr.push(data.toString(...
true
6008baf8b8d8e3394fb44c0086e9af05c8658954
JavaScript
jschlitz/Slideshow
/slideshow.js
UTF-8
1,595
3.265625
3
[]
no_license
"use strict"; //var IMAGES is defined in another file. var SHIFT, FADE, STEADY; SHIFT = 10; FADE = 1500; STEADY = 5000; $(document).ready(function(){ console.log(IMAGES.length); doSlides('#leftImage', 0, IMAGES); setTimeout(function(){doSlides('#rightImage', 50, IMAGES);}, STEADY); }); ///Do the slideshow for ...
true
6fccb0997e3433f94ee24d349cb5022a845a7179
JavaScript
smoreira1/Vanilla-Component-YMCA
/src/ymca-search-component.js
UTF-8
5,165
2.59375
3
[]
no_license
window.ymcaSearchComponent = { apiPath: '', loggedIn: false, async: true, renderResultsNow: false, familyName: 'Not logged in.', filters: { familyCenter: '', zipCode: '', program: '', dayOfTheWeek: '', times: '' }, familyCenters: [], programs: ...
true
edcca49cf833c4e1402d6358106655db72194582
JavaScript
bredek/LoftShool-js
/app/js/hw1.js
UTF-8
341
2.875
3
[]
no_license
function consoleRec(input, index) { if (index < input.length) { console.log(input[index]); consoleRec(input, ++index); } } var hw1 = { init: function() { var testData = ['Ja', 'умею', 'писать', 'рекурсивные', 'функции']; consoleRec(testData, 0); } } hw1.init();
true
278cb0954eb22d4408a4969d10701ea62d84c31e
JavaScript
sayttplx/hamsterwars
/server/scripts/getHamsterById.js
UTF-8
450
2.75
3
[]
no_license
const { db } = require('../firebase') const HAMSTERS = 'hamsters' getHamsterById(id) async function getHamsterById(id) { console.log('Looking for Sixten...'); const hamsterId = id const hamsterSnapshot = await db.collection(HAMSTERS).doc(hamsterId).get() if (!hamsterSnapshot.exists) { consol...
true
a70442dc658f4249a41c98be0e71d3bf8fe79e92
JavaScript
KarpusKonstantin/brackets
/src/index.js
UTF-8
618
2.78125
3
[ "MIT" ]
permissive
module.exports = function check(str, bracketsConfig) { function getBracketsArray (config) { // console.log(config); return config.map(function(item) { // console.log(item.join('')); return item.join(''); }); } let bracketsArray = getBracketsArray(bracketsConfi...
true
36a565f8a6e4ab650c1e1092345804734ac08eb3
JavaScript
vitalyli81/Algorithmic-problems
/src/problem-set-2/dp/permutations/permute.js
UTF-8
508
3.5
4
[]
no_license
/** * @param {number[]} nums * @return {number[][]} */ const permute = nums => { if (!nums) return null; const permutations = []; if (nums.length === 0) { permutations.push([]); return permutations; } const first = nums[0]; const remainder = nums.slice(1); const prevPerms = permute(remainder);...
true
d3f9e54f60073077f7855f60daf2fadd65e415b9
JavaScript
Probir-gayen/blog
/public/js/control.js
UTF-8
4,335
2.546875
3
[ "MIT" ]
permissive
$("document").ready(function(){ var inc = 0; $("#email").blur(function(e){ var check="val="+$('#email').val()+"&opt=email"; $.ajax({ type :'post' , url:"http://localhost/Blog/public/login/ajax", data : check, success : function(d...
true
26e54fab1e4078cba54e47422d7ac25bda58bdf0
JavaScript
ghelloumi/TodoApp
/src/services/pictureFetch.js
UTF-8
283
2.6875
3
[]
no_license
const fetchImage = async () => { const myInit = {method: 'GET', mode: 'cors', cache: 'default'} try { const res = await fetch('http://aws.random.cat/meow', myInit) return res.json() } catch (e) { console.error(e) return null } } export default fetchImage()
true
70c8831f9ea998d210f9c1beb57a7730c79d6f3f
JavaScript
rahamin1/mypet
/src/reducers/_history/AuthReducer.save.js
UTF-8
2,025
2.53125
3
[]
no_license
import * as actions from '../actions/types'; const INITIAL_STATE = { email: '', uid: '', checkAuthInProcess: true, // upon initialization, a check is made // In firebase, whether already logged in loginInProcess: false, loginError: '', signupInProcess: false, signupError: '...
true
cf18194e593769c8d244df1607dfb493ed5fdb17
JavaScript
armandogj1/advent-of-code-2020
/DaySeven/bagChecker.js
UTF-8
1,766
2.9375
3
[]
no_license
const readline = require('readline'); const { createReadStream } = require('fs'); const bagRules = new Map(); const fileStream = createReadStream('./input.txt'); const lineReader = readline.createInterface({ input: fileStream, }); lineReader.on('line', (line) => { const [key, innerMap] = ruleSplitter(line); bagRu...
true
07fbf36fb8a7197d56645270cf450b1cc2429fa7
JavaScript
sirius8611/vocabulary
/src/redux/features/WordList/wordList.js
UTF-8
3,374
2.625
3
[]
no_license
import React, { useState } from 'react' import { useSelector, useDispatch } from 'react-redux'; import {removeWord, selectWordList, changeStatus } from './wordListSlice'; import './wordList.css' export const WordList = () => { const dispatch = useDispatch() const wordlist = useSelector(selectWordList) let btnColor, ...
true
885323c3b607146a4ad090dcc8935836a744a4d0
JavaScript
ajbates2/noteful-assignment
/src/AddFolder/addFolder.js
UTF-8
1,745
2.515625
3
[]
no_license
import React, { Component } from 'react'; import NoteContext from '../noteContext' class AddFolder extends Component { static contextType = NoteContext; handleSubmit = event => { event.preventDefault(); const { folderName } = event.target const folder = { name: folderName....
true
a8f38a1076fd7c826a66d173fd4eaf048e2486bb
JavaScript
niza3001/EnactmentProject
/emid5.3/Assets/Scripts/Screens/GenerateScreen4.js
UTF-8
7,206
2.546875
3
[]
no_license
//Aligning the 3 boxes in all resolutions will be a CHALLENGE! saveMyStrings function saves all the playerprefs at once. //Playerprefs : summaryBegin, summaryMid, summaryEnd, stateOfStory #pragma strict import System.IO; import System; public var customSkin:GUISkin; public var label2Style:GUIStyle; public var la...
true
338571fa4743fc54fa03fea84e97071192c92f24
JavaScript
itsAnyTime/recordShop-mongoose
/controller/orders-controller.js
UTF-8
2,960
3
3
[]
no_license
//importiere das Model für Records (RecordItem) const Order = require('../models/order') //npm packet um codesparender (1 Zeile) Fehler zu schreiben const createError = require('http-errors') //Anfragen mit Callback/////////////////////////////////////////////////////////////////////////////////////// // const orders...
true
7b1baa0d264349b4268496f190950cfcc17988ab
JavaScript
Monicadorthy/Assignment5FrontendDevelopment
/app3Assignment5.4.js
UTF-8
639
2.671875
3
[]
no_license
var Employee= ["Employee name","age","salary","city","state","pincode", {Employeename1:"Employee name" ,age:"age", salary:"salary" ,city:"city ",state:"state", pincode:"pincode"} ,{Employeename2:"Employee name" ,age:"age", salary:"salary" ,city:"city ",state:"state", pincode:"pincode"} ,{Employeename3:"Employee name"...
true
2e77a2e2b718c4f7d9fa11684c9651ffa0ec10b7
JavaScript
alfiomartini/city-weather
/static/old-weather-scripts.js
UTF-8
1,961
3.078125
3
[]
no_license
var CLEAR_RESULT = false; var CLEAR_TABLE = false; // I could use jQuery $(document).ready(function() { /* code here */ }); // window.onload = resetCountry; function buttonClear(){ clearResult(); CLEAR_RESULT = false; } function inputFocus(){ let input = document.querySelector('input'); $('input').fo...
true
9b8addf7d029000f2eedb96f212578abb79a080f
JavaScript
ellipsis-ai/qrcode
/actions/decode/function.js
UTF-8
1,079
2.921875
3
[]
no_license
function(file, ellipsis) { const jpeg = require('jpeg-js'); const PNG = require('pngjs').PNG; const jsQR = require("jsqr"); file.fetch().then(res => { decode(res).then(image => { const code = jsQR(image.data, image.width, image.height); if (code && code.data) { ellipsis.success(code.data); } else...
true
b50c6964795f29c98c47653a0e256314621253c3
JavaScript
StefanS97/free-time-fun-javascript
/phoneNum.js
UTF-8
264
2.9375
3
[ "MIT" ]
permissive
function createPhoneNumber(numbers){ blank = ''; numbers.length == 10 ? numbers.forEach(n => blank += n) : ''; return '(' + blank[0] + blank[1] + blank[2] + ')' + ' ' + blank[3] + blank[4] + blank[5] + '-' + blank[6] + blank[7] + blank[8] + blank[9]; }
true
1b206033389867f5be82da727b2fde2521a2bbb3
JavaScript
veerapos/temp1
/NumberSound.js
UTF-8
7,711
2.890625
3
[]
no_license
function clearZero(Txt) { let i = 0 for(i=0; i<Txt.length; i++){ // ตัดเลข 0 ที่อยู่ข้างหน้าทิ้ง if(Txt[i] !== "0"){ break; } } return Txt.slice(i); } function reverseNumber(txt) { let reverseTxt = ""; for(i=0; i<txt.length; i++){ reverseTxt = t...
true
297c23f67573c2bdd4edb2a83189d6186e35e864
JavaScript
ValentinH/reactfinland2020
/pages/05-field-level-validation/SignupForm.js
UTF-8
2,346
2.546875
3
[]
no_license
import React from 'react' import { Form, Field } from 'react-final-form' import isEmail from 'sane-email-validation' import onSubmit from '../../common/onSubmit' /** * Objective: Convert from record-level to field-level validation * * Requirements: * - It should call `onSubmit` when the form is submitted. * - T...
true
26aca8868c656271664d6b0fd242cce1f3e8663c
JavaScript
SamHenningsen/IntroWebDevelopmentSubmission
/luckySevens/luckySevens.js
UTF-8
2,088
3.515625
4
[]
no_license
function clearErrors() { for (var loopCounter = 0; loopCounter < document.forms["betForm"].elements.length; loopCounter++){ if (document.forms["betForm"].elements[loopCounter].parentElement.parentElement.className.indexOf("has-") != -1){ document.forms["betForm"].elements[loopCounter].parentEle...
true
1593438f96b7a527724ba4c3b4fdd4f8f1fae48a
JavaScript
dylanowen/guac
/snake.js
UTF-8
2,036
3.125
3
[ "MIT" ]
permissive
var DIRECTION_MAPPING = { "right": {dx:1, dy:0, opp:"left"}, "left": {dx:-1, dy:0, opp:"right"}, "up": {dx:0, dy:-1, opp:"down"}, "down": {dx:0, dy:1, opp:"up"}, } var drawSnake = function(newSnake, applePixel) { var goblin = document.createElement("IMG"); goblin.src = "goblin.png"; var drawableSnake...
true
be031d2a1849e9da6f01a3d00084455f7939275b
JavaScript
sudo-cho/droom
/app/assets/modules/useful.js
UTF-8
1,985
2.671875
3
[]
no_license
var useful = { isMobile() { if(window.innerWidth <= 768) return true; else return false; }, getOffset(el) { el = el.getBoundingClientRect(); return { left: el.left + window.scrollX, top: el.top + window.scrollY } }, ...
true
7ad5b9ca0d48c4770b169208095ecdad604669c9
JavaScript
nhatban25912345/Dang-ky-hoc-phan-demo-1
/Đăng ký học phần/guinhat-main/project/JS-Object/ObjectList.js
UTF-8
1,708
2.96875
3
[]
no_license
const $template = document.getElementById("object-list-template"); export class ObjectList extends HTMLElement { id = ""; objects = []; constructor() { super(); this.attachShadow({ mode: "open" }); this.shadowRoot.append($template.content.cloneNode(true)); this.objects = this.shadowR...
true
6237f0bee1c3f3b11de58b69f49a2ef89eb5c8a2
JavaScript
samqty/jGeez
/unittests/jquery.jgeez.js
UTF-8
32,307
2.703125
3
[]
no_license
/* Author : Samuel Teklu Cherinet Version : 1.1.0.0 Date : April 25, 2012 Description : this is a jGeez plugin source code(development version). the library helps users type geez literals directly on their browsers. for further detail please refer to the official jGeez site at this address, http://www.jgeez.com */ ...
true
d442435a88d7454a3544cbec1159608b3369c763
JavaScript
debfdias/Code-Wars
/breaking_chocolate_problem.js
UTF-8
164
3.109375
3
[]
no_license
var breakChocolate = function(n, m) { var area = n * m; var totalBreaks = area - 1; if (totalBreaks <= 0){ return 0; } else { return totalBreaks; }; };
true
2e829cd58e9d64e20d8492b9ad19222888b526a3
JavaScript
carlos8v/trybe-exercises
/exercises/testes-automatizados-com-jest_3/exercise3.test.js
UTF-8
866
3.125
3
[]
no_license
const service = require('./exerciseFunctions'); describe('randomNumber', () => { it('should return a multiplication between three numbers', () => { service.randomNumber = jest.fn().mockImplementation((a, b, c) => a * b * c); expect(service.randomNumber(5, 5, 5)).toBe(125); expect(service.randomNumbe...
true
5fec938ae7b360987584c525d115dfa6cb6e9580
JavaScript
Tcbyco/WatchAndCode
/Practical JavaScript/09_Version_09_EscapeFromConsole.js
UTF-8
3,604
3.828125
4
[]
no_license
// V9: Escape from console // Ul, Li, dynamically adding li and text to the webpage var todoList = { // todos array todos: [], // addTodos method addTodo: function (todoText) { this.todos.push({ todoText: todoText, completed: false }); }, // changeTodo changes the text property of the...
true
ccf58552ac322bf3d9b1bf3e411c2a90067682bb
JavaScript
jesusx21/mongo-migrator
/lib/utils.js
UTF-8
1,130
2.796875
3
[]
no_license
'use strict'; const fs = require('fs'); const pad = function(str, max) { str = str.toString(); return str.length < max ? pad('0' + str, max) : str; }; const getDateArgs = function(date) { return [ pad(date.getFullYear(), 4), pad(date.getMonth() + 1, 2), pad(date.getDate(), 2), pad(date.getHours...
true
92049b08d6e1034941ef2ddb8c6cd1d806f9be0b
JavaScript
Arvy1998/Laboratory-Work-With-Javascript
/2LAB_Arvydas_Baranauskas_PRIF_17_2/index.js
UTF-8
2,657
2.6875
3
[]
no_license
import TodoList from './models/todoList'; import { savePersonData, saveCompanyData, saveTaskData, saveProjectData, saveUsersData, readUsersData, readTaskData, readProjectData, readPersonData, readCompanyData } from './fileStream'; import runMenu from './console-interface'; let ...
true
93fe4bb724c40efc53ac663f28f452d37d28097a
JavaScript
lucie-gonzalez/luciegonzalez_7_19052021
/back-end/controllers/users.js
UTF-8
4,222
2.546875
3
[]
no_license
const mysql = require('mysql') const db = require('../mysql') const bcrypt = require('bcrypt') const jwt = require('jsonwebtoken') const pwdValidator = require('password-validator') const fn = require('../middleware/function') require('dotenv').config(); // Exigence du mot de passe let pwd = new pwdValidator(); pwd .i...
true
8d49f4d6df2a5745894b4d0e1956464e87e60248
JavaScript
asonni/sigorta
/server/modules/api/plans/controller.js
UTF-8
1,988
2.6875
3
[]
no_license
const express = require("express") const _ = require('lodash') const moment = require('moment') const Service = require('./service') class PlansAPIController { plansIndex(req, res) { const service = new Service(req) service.fetchPlans() .then(plans => { res.json({ plans: plans }) }) .catch...
true
16e23cbc31c6cdc5f6056b800078c2d1828d8410
JavaScript
LuckyGStar/LifeJavascriptComponents
/components/matrix-challenge/matrix-challenge.js
UTF-8
274
2.859375
3
[]
no_license
const analyse = (matrix) => { const rowCount = matrix.length; const colCount = matrix[0].length; for (let i = 0; i < rowCount; i++) { for (let j = 0; j < colCount; j++) { const value = matrix[i][j]; } } return matrix; }; exports.analyse = analyse;
true
5f9df6c984539679e160120e17193f84d40df1f6
JavaScript
nikhilxb/xnode-db
/server/client/examples/actions/example.js
UTF-8
1,608
3.03125
3
[]
no_license
/** Action type definitions. */ export const ExampleActions = { // Must take form of `[module]Actions` SYNC_ACTION: "EXAMPLE::SYNC_ACTION", ASYNC_ACTION: "EXAMPLE::ASYNC_ACTION", }; // TODO: Feature grouping // ---------------------- /** Action creator to __. */ export function syncAction(value) { // Must ...
true
0b31c95ae81605ef6e5e04de6e7bcbf10b63d7be
JavaScript
zhongyw/itranswarp.js
/www/cache.js
UTF-8
4,034
2.609375
3
[ "Apache-2.0" ]
permissive
'use strict'; // init memcache: var _ = require('lodash'), thunkify = require('thunkify'), Memcached = require('memcached'), config = require('./config'); // init memcached: console.log('init memcache...'); var DEFAULT_LIFETIME = 86400, // 24h CACHE_PREFIX = config.cache.prefix, memcache...
true
698555ef09bfdbb343e8d46d42c04f6f77049b0a
JavaScript
BPopek/assignments
/exercises/node-calculator/app.js
UTF-8
1,182
4.09375
4
[]
no_license
const readlineSync = require("readline-sync") function add(num1, num2) { result = parseInt(num1) + parseInt(num2) return result } function sub(num1, num2) { result = parseInt(num1) - parseInt(num2) return result } function mul(num1, num2) { result = parseInt(num1) * parseInt(num2) return result...
true
d52b48b14890331f9c1fa0198ac22411670f91d1
JavaScript
catberry/catberry-oauth2-client
/lib/endpoints/AuthorizationCodeFlowEndpoint.js
UTF-8
4,510
2.53125
3
[ "MIT" ]
permissive
'use strict'; const URI = require('catberry-uri').URI; const httpHelper = require('../helpers/httpHelper'); const AuthorizationCodeSender = require('../grants/AuthorizationCodeSender'); const GrantFlowMiddlewareBase = require('../middlewares/GrantFlowMiddlewareBase'); const FIELD_CODE = 'code'; class AuthorizationCo...
true
434286c3c2bb39a0cbd7c8c3d5547a4afecc4582
JavaScript
jfdesrochers/jfdcomponents
/src/statemanager.js
UTF-8
2,510
3.796875
4
[]
no_license
/////////////////////////// // StateManager // Holds various enumerable properties with getter/setters and custom callback support /** * Creates a State Manager * @constructor * @param {object} initState Object containing the initial properties to add of the format : {prop: 'defaultvalue'} or {prop: ['defaultvalue'...
true
d5b5a07c691edd318834340c2bc1d3b5b6e79f0f
JavaScript
Josefine-Schougaard/MUL-Festform
/Festform-prototype/validation.js
UTF-8
2,983
2.984375
3
[]
no_license
// formcheck // Tjekker om inputs er udfyldt med appropiate data type, skriver en validation besked, tilføjer invalid klassen const checkInputs = (form)=>{ let inputsValid = true; const subGroups = form.querySelectorAll('.sub-group, .requiredCheck'); subGroups.forEach(subGroup =>{ const inpu...
true
7006bdc60d4db64deb86ba20283d22dd35d18fba
JavaScript
fschell/cryptool-online
/_ctoLegacy/js/transposition.js
UTF-8
11,092
2.78125
3
[]
no_license
//*******************************(service-layer) //******************************* //******************************* function CTOTranspositionAlgorithm(alpha) { var alphabet=alpha; //transposition (decrypt) //@author Christian Sieche //@version 30.12.2008 //@params: // chipertext (str...
true
ca9057e67dce4d3a860d053dde9203a5ff23b8ae
JavaScript
Nicetomeetyou777/MyProject
/MyProject_hire/hire_server/routes/index.js
UTF-8
5,918
2.671875
3
[]
no_license
var express = require('express'); var router = express.Router(); const { UserModel, ChatModel } = require('../db/model') const md5 = require('blueimp-md5') const filter = { password: 0, _v: 0 }//查询时过滤出制定的属性 /* GET home page. */ router.get('/', function (req, res, next) { res.render('index', { title: 'Express' }); })...
true
b1fdeceb5279877f6adf7f41cb757e4c6f230241
JavaScript
eni9889/FiOS
/src/gui/core/frida/agents/filesystem/writable.js
UTF-8
1,388
2.671875
3
[ "BSD-3-Clause" ]
permissive
module.exports = function(apath){ return new Promise(function (resolve, reject) { if (ObjC.available) { var NSFileManager = ObjC.classes.NSFileManager; var NSString = ObjC.classes.NSString; // get a file manager instance var fm = NSFileManager.defaultManager(...
true
3c3aa3201f2a7650ece609c65eb965275a73da0a
JavaScript
huxiaoshanhe/df
/src/app/search/search.service.js
UTF-8
819
2.515625
3
[]
no_license
(function() { 'use strict'; angular .module('pf.search') .factory('searchService', searchService); searchService.$inject = ['dataService', 'sheetService']; function searchService(dataService, sheetService) { var service = { 'search': getSearchData }; return service; /** * 简...
true
22fdcb59d2bb5b80365c831bd6d1c1ffa6bf2750
JavaScript
DevloperM/weekendPractice
/script.js
UTF-8
3,338
3.421875
3
[]
no_license
let myTextbox = document.querySelector("input"); myTextbox.addEventListener("keydown", handleInputBoxEnterKey); let myButton = document.querySelector("button"); myButton.addEventListener("click", handleJokeButton); function addMsg() { let c = document.querySelector("#chatbox"); //Create Message div bloc...
true
918bb1ebd90d5ff9238b1f06b3e051ccc9c630be
JavaScript
swc-project/swc
/crates/swc/tests/tsc-references/objectTypeWithRecursiveWrappedPropertyCheckedNominally.1.normal.js
UTF-8
1,148
2.59375
3
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
//// [objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts] // Types with infinitely expanding recursive types are type checked nominally import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var List = function List() { "use strict"; _class_call_check(this, List); }; var MyList = func...
true
0d29995c415db0f5ee41d198c6c86de3fbeea6e1
JavaScript
CBNU-8/OpenSourceProject
/kakao_map.js
UTF-8
5,621
3.0625
3
[]
no_license
var mapContainer = document.getElementById('map'), // 지도를 표시할 div mapOption = { center: new kakao.maps.LatLng(36.628583, 127.457583), // 지도의 중심좌표 level: 5 // 지도의 확대 레벨 }; // 지도를 생성합니다 var map = new kakao.maps.Map(mapContainer, mapOption); // 지도에 확대 축소 컨트롤을 생성한다 var zoomCo...
true
1e12840baad3f70f7194a49796cde60c1d0103b3
JavaScript
ocalvet/app_manager
/src/services/Authenticator.js
UTF-8
873
2.625
3
[ "MIT" ]
permissive
import axios from 'axios'; class Authenticator { authenticate = async (username, password) => { try { const response = await axios({ url: `${process.env.REACT_APP_API_URL}/auth/signin`, headers: new Headers({ 'Content-Type': 'application/json' }), method: 'POST', ...
true
11dfcdfc4c3bbf825e81dc9198a74c40cbe8443d
JavaScript
JamalYusuf/JavaScript
/Club Age conditions/script.js
UTF-8
212
3.734375
4
[]
no_license
var age = prompt("What is your age?"); if(age < 0) console.log("Error age cannot be negative!"); else if (age === 21) console.log("Happy 21st birthday!!!"); else if ((age%2)!==0) console.log("your age is odd!");
true
0ad462449185504d64c90298b5b5acd4bbd3e8eb
JavaScript
contibru/bootcampigti
/modulo_02/desafio/index.js
UTF-8
4,743
2.5625
3
[]
no_license
import express from "express" import { promises as fs } from "fs"; import { stringify } from "querystring"; const app = express(); app.use(express.json()) const db = JSON.parse(await fs.readFile("./db/grades.json")) // // // // Logs // // // const myFormat = winston.format.printf(({ // level, // mess...
true
61760beaab9081ca5228e65c39891c814a171d39
JavaScript
LeamonLee/Js_Snippet
/Ninja_tutorial/DOM/TheNetNinja/Tutorial-DOMTraverse1-7/app.js
UTF-8
941
3.828125
4
[]
no_license
const bookList = document.querySelector('#book-list'); // 99% time parentNode and parentElement are gonna return the same element. console.log('book list parent node:', bookList.parentNode); console.log('book list parent element:', bookList.parentElement); console.log('book list parent element:', bookList.parentElemen...
true
24b72b5df6b8bec6f446343081c81ce370856f62
JavaScript
kobzarvs/test-job
/src/modules/testJob1.js
UTF-8
726
3.34375
3
[]
no_license
/** * Вычислительная сложность: O(2n) * Сложность по памяти: O(2n) * Время выполнения на моем ПК 10 млн элементов массива, обработались * данной функицей примерно за 3 сек. */ export const piecesToPercents = ({ list }) => { if (!Array.isArray(list)) return null // 1. Считаем общую сумму элементов const sum ...
true