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
9a10441e5302c412c668ffd8dc7a562c748eb5f1
JavaScript
tombeau19/jeopardy-game
/main.js
UTF-8
14,292
3.09375
3
[]
no_license
$(document).ready(function () { $('.newGame').click(function () { location.reload(); }); let score = 0; //BASEBALL BASEBALL BASEBALL BASEBALL BASEBALL BASEBALL BASEBALL BASEBALL BASEBALL BASEBALL BASEBALL //BASEBALL HUNDRED $('.baseballHundred').on('click', function () { $(th...
true
df0b5bb9b62c6d60cf914f2dcf7e9927ea8c7125
JavaScript
shaozhu520/yixiangbao
/user/js/reg.js
UTF-8
2,213
2.5625
3
[]
no_license
$(function () { $("#send").click(function () {//发送邮箱验证码 var Email = $.trim($(".Email").val());//邮箱; if (isEmail(Email) != false) {//邮箱没有问题 $.post("../ajax/regAjax.ashx", { "parameter": "toMail", "Email": Email }, function (data) { var data = JSON.parse(data)...
true
e5369b099ed60ddfdf2fb94cc2163ec2b7eb98a6
JavaScript
azzinijuli/weatherapp
/src/components/CurrentTemp/index.js
UTF-8
688
2.515625
3
[]
no_license
import "./style.scss"; function CurrentTemp({ current }) { return ( <section> {current.weather !== undefined && ( <div className="weather-wrapper"> <img src={`http://openweathermap.org/img/wn/${current.weather[0].icon}@2x.png`} className="weather-image" ...
true
cc85361db7256ec6a2d34408b2ed1b906cbe429b
JavaScript
th-antolini/node-weatherapp
/app.js
UTF-8
681
3.0625
3
[]
no_license
const geocode = require('./utils/geocode') const forecast = require('./utils/forecast') if (process.argv[2]) { geocode(process.argv[2], (err, { location, latitude, longitude}) => { if (err) { return console.log(err) } forecast(latitude, longitude, (err, { summary, temperature, precipitations}) => {...
true
c941214a4d5be71eaf041c87fd15a808303fea7a
JavaScript
jhuleatt/sweeping-mines
/src/js/App.js
UTF-8
1,840
2.53125
3
[]
no_license
import React, { Component } from "react"; import Grid from "./components/Grid.js"; import GameList from "./components/GameList.js"; import GridProvider from './components/GridProvider.js'; import "../style/App.css"; /** * This is the default gif component that comes with base react */ class App extends Component { ...
true
51c2eadfe68d44fb14f7e58c0ca3caf97d37fe45
JavaScript
haiklnx/NodeJS-TypeScript
/Curso/JS Básico/Aula85/index.js
UTF-8
1,425
4.0625
4
[ "MIT" ]
permissive
function rand(min,max) { min *= 1000; max *= 1000; return Math.floor(Math.random() * (max - min) + min) } function espera(msg, tempo) { // res === resolvendo a promise, sucesso // rej === erro na promise return new Promise((res, rej) => { setTimeout(() => { if (typeof msg !=...
true
adb29e0b9bf37113da5c77fe3f1ae0c0f4f8d3f1
JavaScript
ashenm/project-euler
/007.js
UTF-8
905
4.5625
5
[]
no_license
/** * 10001st Prime * https://projecteuler.net/problem=7 * Computes the 10001st prime * * Ashen Gunaratne * mail@ashenm.ml * */ /** * @function nprime * @summary Computes n-th prime * @param {Number} n * @description Returns the nth prime */ const nprime = function computeNthPrime(n) { let prime = 2; ...
true
fe3a882f51dd1c8dda8184315327798ce0e68c93
JavaScript
ldevernay/code_promo2
/Randoris/006 - ChiffreDeCesar/Version unicode et TDD/app.js
UTF-8
768
3.390625
3
[]
no_license
/*function caesar (str,cypher) { if(cypher<1 || cypher>25) return ("cypher between 1 and 25 only"); // cypher interval var upper = str.toUpperCase().split(''); // array and uppercase return(upper.map(function(x){ if(x.charCodeAt(0)>=65 && (x.charCodeAt(0)<=90)) // only letter return String.fromCharCode((x.ch...
true
d51e6827930e3e71ac7c3a401bf4e396e9f4639e
JavaScript
khalilholberton/holbertonschool-higher_level_programming
/0x12-javascript-warm_up/9-add.js
UTF-8
243
3.015625
3
[]
no_license
#!/usr/bin/node const myfarg = process.argv[2]; const mysarg = process.argv[3]; const firstnum = parseInt(myfarg, 10); const secondnum = parseInt(mysarg, 10); console.log(add(firstnum, secondnum)); function add (a, b) { return a + b; }
true
0834146b09a70cbbee3b87a9ebd4482171675f1f
JavaScript
igqueiroz/geolocationappgit
/client/src/logic/DataApi.js
UTF-8
2,387
3.078125
3
[]
no_license
// Lógicas do App, envia as requisições aos reducers e mantém as views focadas na exibição de conteúdo //Envia via POST todos os dados coletados durante as interações do usuário export default class DataApi { static save(name,email,userlocationlat,userlocationlng,userDevice,range,universityLat,universityLng){ ...
true
d317391b2ddd5ca984f0db0ba764c6d341686905
JavaScript
ledinhluongstd/draw-rectangle-polygon-canvas
/src/view-image/rectangle.js
UTF-8
1,826
2.828125
3
[]
no_license
export default class Rectangle { constructor(args) { this.position = args.position this.active = args.active this.activeStrokeStyle = args.activeStrokeStyle this.strokeStyle = args.strokeStyle this.type = "RECTANGLE" this.enableMove = true this.display = args.display } activeItem(self...
true
3e1fc90c3eccf1373f4b42734afe9b334bf9ad63
JavaScript
gitaakashstack/Node.js-Projects
/Batsman Bowler Team Collection/model/team.js
UTF-8
1,187
2.65625
3
[]
no_license
const mongoose=require('mongoose'); const Schema=mongoose.Schema; const teamSchema=new Schema({ country:{ type:String , uppercase:true }, rank:Number }); const Team=mongoose.model("Team",teamSchema); Team.countDocuments({}).then(cnt=>{ if(!cnt)/*checking if the ...
true
4a93f78687987b05db12b6e174b0555f0df0143e
JavaScript
LaszloBogacsi/ExercismIO
/javascript/grains/grains.js
UTF-8
379
3.015625
3
[]
no_license
var bigInt = require('./big-integer'); function Grains() { } Grains.prototype.square = function (power) { var bigNum = bigInt(2).pow(power - 1); return bigNum.toString(); }; Grains.prototype.total = function () { var total = 0; for (var i = 1; i < 65; i++) { total = bigInt(total).add(this.square(i)) }...
true
6a4df5879c17718aca0c42dd69afdf59cfedacf8
JavaScript
iitsukaSho/amurant
/src/js/_modules/onload-addclass.js
UTF-8
251
2.515625
3
[]
no_license
export default function onLoadAddClass(addClassList) { const addClassName01 = Object.keys(addClassList); addClassName01.forEach((data) => { for (let addClassItem of addClassList[data]) { addClassItem.classList.toggle(data); } }); }
true
4add180d699ff1543b87cb16af5f051636c80a4e
JavaScript
MichelleHettinger/Making-a-reservation-server
/app/routing/api-routes.js
UTF-8
578
2.59375
3
[]
no_license
var tables = require("../data/table-data.js"); var waitings = require("../data/waitinglist-data.js"); module.exports = function (app){ app.get('/api/tables', function(req, res){ res.json(tables); }); app.get('/api/waitlist', function(req, res){ res.json(waitings); console.log(waitings); }); app.post('/a...
true
d29faf8e68264cdd4505418fc4cb0cce15e40715
JavaScript
Ariful4593/profile
/profile.js
UTF-8
3,695
2.78125
3
[]
no_license
document.title = "Ariful Islam"; var profile = document.getElementById("navbar-brand"); console.log(profile); profile.textContent = " Facebook"; var ul = document.getElementsByClassName("nav-link"); var ul_array = ["Home","Gallery","Contact us","About us"]; for(i=0;i<ul_array.length;i++) { ul[i].textContent = ul_array...
true
52cd4de96dd055b7e2799f3b485c08dccea59e26
JavaScript
VBGH/Curs-JS-Primava-2020
/tema1/tema1.js
UTF-8
841
3.4375
3
[]
no_license
console.log('Exercitiu 1'); const PI = 3.14; let razaCer = 10; let ariaCerc = PI * razaCer ** 2; console.log(`Aria cercului cu raza de ${razaCer} cm este: ${ariaCerc}`); console.log('...........'); console.log('Exercitiu 2'); const filme = [ 'spiderman 1', 'spiderman 2', 'spiderman 3', 'avangers 1',...
true
64dbbdd0693ecc3b5ec70a00e5341c5e243a1e6d
JavaScript
cpang888/WordGuessGame
/assets/javascript/game.js
UTF-8
5,683
3.59375
4
[]
no_license
// this is an array with objects. // each object contains name, image and sound var words = [ {name: "usa", image: "usa.PNG", sound: "usa.mp3"}, {name: "canada", image: "canada.PNG", sound: "canada.mp3"}, {name: "china", image: "china.PNG", sound: "china.mp3"} ]; // this is game...
true
87f0e3b44b8ad493adaa73495cd289d671230cac
JavaScript
Mrdouhua/works
/weixuelin/weixuelin/scripts/career-explor.js
UTF-8
6,198
2.796875
3
[]
no_license
$(function(){ // 课程导航功能 (function(){ // 专业部分ajax请求 $(".proNavItem").click(function(){ var requData = $(this).text(); var sumbData = { "subject_name": requData }; var that = this; // 请求返回地址 var url = "/weixuelin/AjaxManager?"+"user_id=111111111"+"&timestamp"+new Date().getTime(); $...
true
aabea5bdb8c7fbda26a9419891d1643d8fbca881
JavaScript
vesnaguja/BIT-PP
/07bFunctions1/task06.js
UTF-8
327
4.3125
4
[]
no_license
// //6. Write a program that draws a horizontal chart representing three given values. For example, if values are 5, 3, and 7, the program should draw: // * * * * * // * * * // * * * * * * * const drawHorizontalChart = (...args) => (args.map(arg => '* '.repeat(arg))).join('\n'); console.log(drawHorizontalChart(5, 3, ...
true
a20c0464fc02997840add7a22bbe2bc2d329801b
JavaScript
najarvis/PacManJS-E
/game_scripts/drawing.js
UTF-8
13,703
3.015625
3
[]
no_license
/** A class which handles the drawing of everything. * @param canvas The canvas to draw to. */ function drawing(canvas) { var SPHERE_QUALITY = 10; var scene = new THREE.Scene(); //From https://stackoverflow.com/questions/41786413/render-three-js-scene-in-html5-canvas var renderer = new THREE.WebGLRenderer...
true
4745ebd332b75cbeea699d038789d37453d237c7
JavaScript
leetia316/XMLHttpRequest
/XMLHttpRequest.js
UTF-8
1,477
2.84375
3
[]
no_license
/*sendajax*/ window.linAjax = function(object){ var xhr = new XMLHttpRequest(), type = object.type.toLowerCase(); if(type == 'post'){ object.data = setPostData(object.data); } xhr.onerror = object.error; xhr.timeout = object.timeout ? object.timeout : null; xhr.ontimeout = function(...
true
2313d9b36d356e2e77d0752bb45caab929aa9a63
JavaScript
happyminjs/notes
/面试题记录/node/1.eventloop/2.js
UTF-8
2,860
3.078125
3
[]
no_license
// Node 是什么, 可以做什么 (生态完整) // Node 是 runtime(运行时) ,可以让 js 运行在服务端上 // 内置模块 文件读写 操作系统 及其api // js 基本组成: (BOM, DOM 服务端没有), ECMAScript, 模块的特性(提供了 api 方法,来实现文件操作,服务器端的创建) // node 只包含了 ECMAScript + 模块 // node 一般用来做中间层 解决跨域问题 ssr的实现 工具 (框架: egg nest ) 做一些后台项目 // 高并发(单线程---因为js的主线程是单线程) ---- 因为 node 是非阻塞异步 I/O 特性 // ----...
true
7bbe2138b030c79c370c1a8662e07e2e60a093dd
JavaScript
manix/the-console
/commands/eval.js
UTF-8
477
2.890625
3
[]
no_license
exports.description = "Run any arbitrary code"; exports.arguments = [{ name: "code", description: "The javascript code you would like to run", validate: function (value) { return value ? null : "code is required"; } }]; exports.options = {} exports.execute = function (args, options) { let [code] = args...
true
41ef26e5c3b3a86467d475c20b6ca74826e7e36a
JavaScript
Composur/resume
/review/recode/js/this.js
UTF-8
533
3.484375
3
[]
no_license
'use strict' var log=console.log.bind(console) log('call、apply、bind') function fn(a,b){ log(a,b) } fn(1,2) //the same with //在严格模式下fn的this就是call的第一个参数,非严格模式下会替换为window fn.call(undefined,1,2) log(fn.this) fn.apply(undefined,[1,2]) var obj={ fn1:function(a,n){ log(this) }, fn2:{ child:fu...
true
c42218f5b51b943ebc530ac6917bcf0b12503b95
JavaScript
Unknownlurkr/clipped-ionic
/src/backups/server.js
UTF-8
2,893
2.640625
3
[]
no_license
/* eslint-disable no-param-reassign */ import { express } from "express"; import {bodyParser} from "bodyParser"; import {fs} from "fs"; import { path } from "path"; const app = express(); //define data files to be used in read operations for get and post, later on const PRODUCT_DATA_FILE = path.join(__dirname, 'serv...
true
b152c30f26ba3e1e59889da63d4a8cfbe25ac62b
JavaScript
ngoldstein51/FlockingBirds
/sketch.js
UTF-8
2,242
3.03125
3
[]
no_license
let nodes = []; let birds = 100; let clost_dist = 20; let med_dist = 50; let far_dist = 150; let speed = 10; let width = 1920; let height = 900; function setup() { createCanvas(width, height); console.log(width, height); for (var i=0;i<birds;i++) { let adding = {name:i.toString(), pos:[900,450], di...
true
03b08319a829bcc35dd0492144f92e85d69fcb5c
JavaScript
FMRb/leetcodejs
/maximum-gap.js
UTF-8
1,150
3.09375
3
[]
no_license
var DEBUG = process.env.DEBUG; /** * @param {number[]} nums * @return {number} */ Array.prototype.max = function () { return this.reduce((p, c) => Math.max(p, c), -1); }; Array.prototype.min = function () { return this.reduce((prev, curr) => Math.min(prev, curr), Math.pow(2, 32)); }; var maximumGap = functio...
true
1eae146d1ca1861844bd8d1fae15ff6a7fded6d8
JavaScript
yodlr/node-yodlr
/lib/tools.js
UTF-8
1,863
3.21875
3
[]
no_license
var os = require('os'); var uuid = require('node-uuid'); var api = {}; module.exports = api; // api.isObject // ---------------- // // Returns true if the given value is an Object. // // __Parameters__ // * object: `Object` - _Object_ // // __Return__ // * value: `true/false` - _Boolean_ api.isObject = function(value...
true
b518f5ea5ee51d128b10792018ee2492c9e72e19
JavaScript
individuals2/Learn-1
/Web/JS/EloquentJS/chapter7/exercise.js
UTF-8
2,370
3.359375
3
[]
no_license
// * Retry class InputError extends Error { constructor(message){ super(message) } get name(){ return "InputError" } } function primitiveMultiply(a, b){ // * Math.round(Math.random()) // * Math.random() > .5 if(Math.floor(Math.random() * 2)){ return a * b }else{ throw new InputError...
true
215b95650598e4f3b38818f76433ab90be432dea
JavaScript
Zhoonya/979263-big-trip-11
/src/components/trip-day.js
UTF-8
998
2.65625
3
[]
no_license
import AbstractComponent from "./abstract-component.js"; import {formatMonthDate} from "../utils/common.js"; // День путешествия и контейнер для списка точек маршрута const createTripDayTemplate = (day, date) => { const dayCounter = day ? `${day}` : ``; const attributeDate = date ? `data-datetime="${date}"` : ``; ...
true
ce50f14f85e290438b616af96c05df7f8386ff25
JavaScript
NikiStanchev/SoftUni
/React Fundamentals/Redux/redux-app/src/reducer/index.js
UTF-8
855
2.515625
3
[ "MIT" ]
permissive
export default (store=[], action)=>{ switch(action.type){ case 'INCREMENT': return [...store.slice(0, action.payload.index), Object.assign({}, store[action.payload.index], {value:store[action.payload.index].value + action.payload.step}), ...
true
7ba5ae1ad6f617d0a8ad416b01b83432d5bf6b3b
JavaScript
Prashant-Tiwari-web/sip
/script.js
UTF-8
2,087
3.046875
3
[]
no_license
//standard calculator function pushBtn(obj){ var inputlabel = document.getElementById('inputlabel'); var pushed = obj.innerHTML; if(pushed== '='){ inputlabel.innerHTML = eval(inputlabel.innerHTML); } else if(pushed == 'All Clear'){ inputlabel.innerHTML = '0'; }else{ if(inpu...
true
9567f82884cfdcd5b20e5c2a97d54149a6728259
JavaScript
jenniferchen95/leetcode
/1477. Find Two Non-overlapping Sub-arrays Each With Target Sum.js
UTF-8
2,006
3.96875
4
[]
no_license
// Given an array of integers arr and an integer target. // You have to find two non-overlapping sub-arrays of arr each with sum equal target. There can be multiple answers so you have to find an answer where the sum of the lengths of the two sub-arrays is minimum. // Return the minimum sum of the lengths of the two ...
true
e222dd28197adf87e75a46b4ab5505a04e916f3d
JavaScript
jdferrell0909/Online-Order-v3
/src/screens/UpdateItem.js
UTF-8
3,473
2.640625
3
[]
no_license
import React, { useEffect, useState, useCallback } from 'react'; import { Form, Button } from 'react-bootstrap'; import { LinkContainer } from 'react-router-bootstrap'; // const regeneratorRuntime = require('regenerator-runtime'); import axios from 'axios'; const UpdateItem = ({ match }) => { // would like to figure...
true
092a1bc00bd77a603f9dc0b1453565c881a6a501
JavaScript
763077374/books
/javascript/chapter06/chatroom/signup.js
UTF-8
828
2.78125
3
[]
no_license
/** * 用户注册 * @param socket * @param data 用户名 * {protocal: 'signup', username: '小明'} * @param users 用户组 */ exports.signup=function (socket,data,users) { // 处理用户注册请求 var username = data.username; // 如果用户名不存在,则将该用户名和它的Socket地址保存起来 if (!users[username]) { users[username] = socket; ...
true
efcec1d52b4d2ffc2edb3085c2f4d4f997a98e77
JavaScript
nstavrev/JavaEE_FMI
/WebContent/js/register.js
UTF-8
786
2.515625
3
[]
no_license
$.ajax({ url : "../rest/user/roles", type : "GET", success : function(data) { data.forEach(function(role){ $("#roles").append($('<option>', { value: role.id, text: role.name })); }); } }); function register() { var user = { userName : $("#username").val(), ...
true
bdbf9e936a820c978245f15c8d7facc713d96454
JavaScript
MillieYun/electron-react-boilerplate
/app/script/todoList/TodoList.jsx
UTF-8
1,023
2.578125
3
[ "MIT" ]
permissive
import React from 'react'; import {TodoItem} from './TodoList.component'; import _ from 'lodash'; class TodoList extends React.Component { constructor (props) { super(props); this.state = { items: [{content: 'abc', id: 0}, {content: 'efg', id: 1}], checked: [0] }; ...
true
f85b451bbe12709bcca49c225cfeabff758fbbb4
JavaScript
dadajam4/dd-skelton
/plugins/ui/util/getObjectValueByPath.js
UTF-8
586
2.984375
3
[]
no_license
export default function getObjectValueByPath(obj, path) { // credit: http://stackoverflow.com/questions/6491463/accessing-nested-javascript-objects-with-string-key#comment55278413_6491621 if (!path || path.constructor !== String) return; path = path.replace(/\[(\w+)\]/g, '.$1'); // convert indexes to properties ...
true
05c5c5a75c2fee990beb683c1ace26a03765dede
JavaScript
jiteshsamal/Node-Rest
/api/controller/expenses.controller.js
UTF-8
1,573
2.5625
3
[]
no_license
const express = require('express'); const router = express.Router(); const mongoose = require("mongoose"); const Expense = require("../models/expense"); function getExpenses(req,res){ Expense.find() .exec() .then(docs => { console.log(docs); res.status(200).json(docs); }); } function addEx...
true
26982b425d96f79d9ed27be942943ca5b5fe55b6
JavaScript
sangretu/bastion
/bastion.js
UTF-8
7,443
3
3
[]
no_license
/** * bastion.js * * A container for a bulwark implementation and its supporting material. * * v0.0.0-BLM * 202104 * aaron ward * * Doing something a bit new here and trying to use bulwark as a standard for * much of the data passing between functions, has required some careful * consideration, but I think...
true
f484e7cc2b8f00d18233176141fe819f373cd895
JavaScript
mambru82/password_generator
/assets/js/script.js
UTF-8
4,943
4.34375
4
[]
no_license
// Assignment code here //initialize string variables for all possible characters involved var specialCharacters ="\"$%&'()*+,-./:;<=>?@[\\]^_`{|}~"; var numeric = "0123456789"; var lowercase = "abcdefghijklmnopqrstuvwxyz"; var uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; //random number generator function function random...
true
6191795f3b259daedb0c9b4f2e3a06cb8110cf47
JavaScript
acanoenfr/agd-2018
/www/js/addEvent.js
UTF-8
3,623
2.734375
3
[ "MIT" ]
permissive
// Fonction vérifiant le contenu du titre de l'événement après avoir appuyé sur une touche $("#ipTitle").keyup(function() { // Si il y a quelque chose dedans if ($(this).val()) { $(this).css("borderColor", ""); // Couleur de bordure par défaut $(this).css("borderWidth", ""); // Taille de bordure par défaut $(th...
true
34454eace05b4cfb815a8f7291ed5b30f1c64d3c
JavaScript
yuedehuanxiang/note
/nodejs/FileSystem/1.js
UTF-8
1,476
3.15625
3
[]
no_license
const fs = require("fs"); // 如果目录不存在,创建文件就会失败 // first error node 中的一种约定,如果一个回调可能有错误情况,那么约定 // 回调函数的第一个参数专门用来提供错误对象 // fs.writeFile("./1.txt", "hello", (err) => { // 异步写入文件 // console.log(err); // 如果成功是null ,失败则会打印一个错误对象 // console.log("文件写入成功"); // }) // let res = fs.writeFileSync("./1.txt", "bilibili"); // 同步写...
true
c6e9f70b4e014b941183d6bb769586b127687180
JavaScript
ChrisC1995/week3
/oldscripts/loops 2.js
UTF-8
1,912
4.375
4
[]
no_license
//keeps things going as long as the condition is not met. // for loops and for each loops are most common, while loop( will execute as long as code is true), do while loop. (will run through at least once.) //while var count = 3; while (count<=5) { //write while, go down to the empty box icon, it writes the code base) ...
true
f7a6e994deb235c86ca0a15c821e8e6521566017
JavaScript
samsmith453/samsmith453.github.io
/assets.js
UTF-8
4,620
2.78125
3
[]
no_license
var pics = [ // when adding new assets: add new element here and also change the draggedIt function // which currently presumes that if greater than 8, the index should reset to 0 // this will have to be increased to add more elements // and add it in index.html to the div { url: "assets/minimaxPic...
true
7ce6d4b9e3c70f3ff8952df9bbb4f6b23519dca5
JavaScript
kimbyeongseok/coding-test-study
/2.스택:큐/custom.js
UTF-8
3,251
3.96875
4
[]
no_license
//다리를 지나는 트럭 // 문제 설명 // 트럭 여러 대가 강을 가로지르는 일 차선 다리를 정해진 순으로 건너려 합니다. 모든 트럭이 다리를 건너려면 최소 몇 초가 걸리는지 알아내야 합니다. 트럭은 1초에 1만큼 움직이며, 다리 길이는 bridge_length이고 다리는 무게 weight까지 견딥니다. // ※ 트럭이 다리에 완전히 오르지 않은 경우, 이 트럭의 무게는 고려하지 않습니다. // 예를 들어, 길이가 2이고 10kg 무게를 견디는 다리가 있습니다. 무게가 [7, 4, 5, 6]kg인 트럭이 순서대로 최단 시간 안에 다리를 건너려면 다음과 같이 건너야 ...
true
eaf88ddde5e846d49120f05afce4d89841c5a741
JavaScript
Sumanthhs27/Expense-Tracker-using-ReactJS
/src/components/NewExpense.js
UTF-8
1,278
2.71875
3
[]
no_license
import React, { useState } from "react"; import "./styles/NewExpense.css"; import ExpenseForm from "./ExpenseForm"; const NewExpense = (props) => { ////// 1st Step of fetching data from child to parent //////// ////// Create a call back function (userExpenseData) which will eventually fetch data ...
true
d826bfc44ca498940035ece747578a29f9171088
JavaScript
zhufengnodejs/20170react
/history/11.control.js
UTF-8
1,006
3.0625
3
[]
no_license
import React,{Component} from 'react'; import {render} from 'react-dom'; // 非受控组件 非受控元素,值不受状态控制 class Sum extends React.Component{ handleChange = (event)=>{ let a = parseInt(this.a.value||0); let b = parseInt(this.b.value||0); this.result.value = a+b; } render(){ //ref等于一个函数,...
true
94cbffa6c0b06e3633cab46d574e350986e21751
JavaScript
kikonen/host
/app/assets/javascripts/test/typeahead_svelte_init.es6
UTF-8
3,829
2.546875
3
[]
no_license
import Typeahead from '@kikonen/typeahead_svelte/typeahead_svelte'; function setupTypeahead() { let items = [ { text: 'local', desc: 'hippo', }, { text: 'foo', desc: 'hippo', }, { separator: true, }, { text: 'No results 1', disabled: true, }, ...
true
d268673123930e98099a9e115d1edba4d1cca320
JavaScript
hchesnutt/cdminer
/lib/validParam.js
UTF-8
1,627
2.828125
3
[ "MIT" ]
permissive
const findByYearValidator = (year) => { const isNumber = !Number.isNaN(+year); const isValid = (year.length === 4 && isNumber); if (!isValid) { throw Error('Param must be a year.'); } return true; }; const validParam = { locate: (state) => { if (state.length !== 2 || typeof state...
true
912dde22b91a4fd42a24dd6ef3318150c4b38f7b
JavaScript
DataRozhlas/anketa-reditele-nemocnic
/js/script.js
UTF-8
2,918
2.8125
3
[]
no_license
import "./byeie"; // loučíme se s IE import { h, render, Component } from "preact"; /** @jsx h */ let host = "https://data.irozhlas.cz/anketa-reditele-nemocnic"; if (window.location.hostname === "localhost") { host = "http://127.0.0.1:54000"; } class Container extends Component { state = { data: this.props.d...
true
2f6e58fc5aa43eda5502157e7b5ae640d501de80
JavaScript
sim-my/sim-my.github.io
/JSAssignment/sortByKey.js
UTF-8
554
3.671875
4
[]
no_license
var arr = [{ id: 1, name: 'John', }, { id: 2, name: 'Mary', }, { id: 3, name: 'Andrew', }, { id: 4, name: 'Andrew', }]; function sortBy(arr, key) { var array = arr; for(var x=0;x<array.length; x++){ for(var y = 0; y<array.length-1; y++){ if(array[y][key]>arra...
true
550fb6a11cafd4ac7b681ccdad7cf036fcf9c4aa
JavaScript
mohammedlaslaa/node-course
/mongoose-modling-relationships/first.js
UTF-8
871
3.359375
3
[]
no_license
// Trade off between query performance vs consistency // Using References (Normalization) ---> Consistency : by this approach if we decide to modify the author, all of those courses will be modified, but everytime when we querying the course, we need to do an extra query to load the related author let author = { ...
true
08976253bff38e3e25243743496fe1a4c20fe826
JavaScript
redDragonLH/make-javascript-API
/src/array/reduce.js
UTF-8
2,878
3.328125
3
[]
no_license
/** * reduce 隶属于 ES5 * * 说明: 对数组中的每个元素执行选定的callback函数 * * reduce 参数; * 1. callback:调用函数 * 2. initialValue: (可选) 作为第一次调用callback时的第一个参数。如果没有提供initiaValue ,那么数组中的第一个元素将作为 callback的第一个参数 * * callback 包含四个参数 * 1. previousValue : 表示“上一次” callback 函数的返回值 * 2. currentvalue: 数组遍历中正在处理的元素 * 3. currentIndec : (可...
true
1df91a9680ab25602aef6a2e4bfe597d48e092ef
JavaScript
dojo-react-workshop/matt_matuszak
/coding-challenges/counter-app/src/Counter.js
UTF-8
1,596
2.625
3
[]
no_license
import React from 'react'; // import ReactDOM from 'react-dom'; class Counter extends React.Component { state = { counter: 0 } increment = () => { const newIncrementVal = this.state.counter + 1; // console.log('new increment val', newIncrementVal); this.setState({ ...
true
c704e159cea264e550752546f3c10f04d1dd97b1
JavaScript
eddie75espinoza-dev/JS_Electron_FlowGlam_Desk
/src/app/appcourse.js
UTF-8
1,576
2.765625
3
[]
no_license
const { remote } = require('electron'); const main =remote.require('./main'); let rowCourse = 0; var total = 0; const dateForm = document.getElementById('dateForm'); const dateConsult = document.getElementById('dateConsult'); function callAllCourses(event) { event.target.addEventListener('click', async () => { ...
true
e32ee571a77f760e83f7a93e9f50408736967403
JavaScript
poushitaguha/country-trivia
/frontend/src/components/CountryDetails.js
UTF-8
2,338
2.765625
3
[]
no_license
import React, { Component } from 'react'; import axios from 'axios'; class CountryDetails extends Component { constructor(props) { super(props); this.state = { name: '', capital: '', currency: '', region: '', flag: '', population: '', language: '' }; } compo...
true
05571f3107cc048b97854bd81f520c8b6444a31c
JavaScript
santiago-blip/simulacroCarrito
/src/main/resources/static/js/modales.js
UTF-8
2,470
2.75
3
[]
no_license
var sesion = document.getElementById("modalIniciar"); if (sesion !== null) { var contenedor = document.getElementById("contenedorSesion"); var modal = document.getElementById("modalSesion"); sesion.addEventListener("click", (e) => { e.preventDefault(); contenedor.classList.toggle("mostrarSes...
true
5821abbdf0d61e5e9dd29067f7f3007d8c51ad71
JavaScript
samzyconcepts/signup-form
/main.js
UTF-8
1,624
3.390625
3
[]
no_license
const firstName = document.querySelector('#firstName'), lastName = document.querySelector('#lastName'), email = document.querySelector('#email'), password = document.querySelector('#password'); // target the form for submission document.querySelector('#form').addEventListener('submit', function (e) { e.preven...
true
976b26754a08c466fea9c7dde317d13df5e3ecd3
JavaScript
waltervfaustine/d2-ui
/packages/period-selector-dialog/src/modules/RelativePeriodsGenerator.js
UTF-8
3,225
2.671875
3
[]
no_license
const DaysPeriodType = { generatePeriods() { return [ { id: 'TODAY', name: 'Today' }, { id: 'YESTERDAY', name: 'Yesterday' }, { id: 'LAST_3_DAYS', name: 'Last 3 days' }, { id: 'LAST_7_DAYS', name: 'Last 7 days' }, { id: 'LAST_14_DAYS', name: 'Last ...
true
3c3985b59126ac7ba315779e00f01a9ae90e3cce
JavaScript
kiyaGu/personal-profile
/public/assets/js/numberPuzzel/puzzelEntry.js
UTF-8
272
2.90625
3
[]
no_license
//construct objects to hold position, x and y coordinate let PuzzelEntry = function(position, puzzelNumber, currentLocation) { this.position = position; this.puzzelNumber = puzzelNumber; this.currentLocation = currentLocation; } module.exports = PuzzelEntry;
true
430d74f2dd3eb048e8c289499da87ae727b05b06
JavaScript
pheinicke/cordova-promise-fs
/src/index.js
UTF-8
22,527
2.625
3
[]
no_license
(function() { 'use strict'; /** * Static Private functions */ /* createDir, recursively */ function __createDir(rootDirEntry, folders, success, error) { rootDirEntry.getDirectory(folders[0], { create: true }, function(dirEntry) { // Recursively add the...
true
689ffd7426bafbc4c16fcd6fea38d865ab8b3b65
JavaScript
rabiul1924/advanced-javascript
/null-vs-undefined.js
UTF-8
754
4.0625
4
[]
no_license
//undefined //1 way let pakhi; console.log(pakhi); //2 way function add(num1, num2) { console.log(num1 + num2); } const result = add (13, 82); console.log(result); //3 way function add2(num1, num2) { console.log(num1 + num2); return } const result1 = add2 (13, 82); console.log(result1); //4 function ...
true
960a190d2be38758859bf10a545c54477edccb0b
JavaScript
elshaw82/Memory-Game
/script.js
UTF-8
3,175
3.4375
3
[]
no_license
document.addEventListener('DOMContentLoaded', () => { // cards const cardArray = [ { name:'cher', img: 'images/cher.jpg' }, { name:'cher', img: 'images/cher.jpg' }, { name:'dionne', img: 'images/dionne.jpg' }, { name:'dionne', ...
true
48bf048254ddc1c4e637183e703a6437be21eea4
JavaScript
rlakenvelt/aoc2020
/day04/day4a.js
UTF-8
859
2.75
3
[]
no_license
const shared = require('../common/base.js'); let answer = 0; const required = ['byr', 'iyr', 'eyr', 'hgt', 'hcl', 'ecl', 'pid']; shared.start("day 4A"); const rows = shared.getInput(); const passports = rows.reduce((list, line) => { if (line==='') { list.push([]); return list; } const pai...
true
b87528afd414da0e8b4143ab5dc4d0b6bcf776bc
JavaScript
klembot/chapbook
/src/runtime/state/__tests__/index.js
UTF-8
4,470
2.875
3
[ "MIT" ]
permissive
import * as state from '../index'; import event from '../../event'; /* These tests pollute the window variable, and in general require some care because they run in parallel. They use different state variable names so that they don't interfere with each other. */ afterEach(() => { state.reset(); delete window.looku...
true
dfe94db5e687563628f40e0743410dc5122aa46e
JavaScript
ShreyaAgarwal2006/cl-ean-it-up
/sketch.js
UTF-8
821
2.75
3
[]
no_license
const Engine = Matter.Engine; const World = Matter.World; const Bodies = Matter.Bodies; const Body = Matter.Body; var ground; var wall1,wall2,wall3; var ball; function preload() { } function setup() { createCanvas(800, 700); engine = Engine.create(); world = engine.world; //Create the Bodies Here. groun...
true
c95a9bbf2d31786402fdab8b2576c89e9cbb74a4
JavaScript
shakked/cs546-final-project
/model/happyHours.js
UTF-8
4,865
2.65625
3
[]
no_license
const mongoCollections = require('../config/mongoCollection'), passwordHash = require('password-hash'), bars = mongoCollections.bars, barSpecials = mongoCollections.barSpecials, barSpecialReviews = mongoCollections.barSpecialReviews, ObjectId = require('mongodb').ObjectId; exports.createBar = async...
true
b2364692175f2cfa48067a58df195581b8889301
JavaScript
danianith/BootCamp_React_Web_Developer
/desafios_de_js_sol_problemas/desafio2.js
UTF-8
2,387
3.546875
4
[]
no_license
/* Desafio 2 - Cardápio Aéreo Durante um longo voo é comum que as companhias aéreas ofereçam alguma refeição aos seus passageiros, e é comum as aeromoças conduzirem carrinhos contendo tais refeições pelos corredores do avião. Sentado numa fileira, você avista o carrinho chegando até você, a qual em um piscar de olhos...
true
4fcd94ed5842f1f6fd22c154da46ca0a776f357a
JavaScript
a100q100/creatine
/src/legacy/ProgressBar.js
UTF-8
11,396
3.25
3
[ "MIT" ]
permissive
/* * ProgressBar * * Copyright (c) 2014 Renato de Pontes Pereira. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, cop...
true
cbe29e03cd1343f5e95dedcb7981941755f628b8
JavaScript
AzadaLee/nodejs
/copy/tool/net/createServeSelf.js
UTF-8
1,180
3.078125
3
[]
no_license
var net = require('net'); /** net.createServer([options], [connectionListener]) 创建一个新的TCP服务, 参数connectionListener会被自动作为connection事件的监听器;或者写成。。.on('connection',function(){。。。。}) TCP服务含有事件: 事件: 'listening':在服务器调用 server.listen绑定后触发。 事件: 'connection' 事件: 'close' 事件: 'error' */ var server = net.createServer(fun...
true
b4027304c84c3c240b48f59a8e1a8e31c1f2c9ca
JavaScript
cdtinney/cella
/framework/public/code/editMap.js
UTF-8
932
3.0625
3
[]
no_license
$(document).ready(function() { editableMap.printToPage(); }); /* * Saves the current map to the database */ function saveMap() { // Create an empty object mapToSave = {}; // Set the cells to the editable map cells mapToSave.cells = editableMap.cells; // Set the name to the user-specified name mapToSave.name =...
true
1874b870bc635aa1fd06a3401e570d2976d19d62
JavaScript
MATTEOTOSINI94/js-snack-es6
/js/master.js
UTF-8
3,190
3.703125
4
[]
no_license
// Snack 1 // Creare un array di oggetti: // Ogni oggetto descriverà una bici da corsa con le seguenti proprietà: nome e peso. // Stampare a schermo la bici con peso minore utilizzando destructuring e template literal const sellBike = [ { nome: "Mountain bike", peso:40, immagine: "1.jpg" }, { ...
true
9a9baf6ef4dea851448be0ceb382274a45c40aae
JavaScript
zynga/core
/src/core/io/Image.js
UTF-8
1,868
2.53125
3
[ "MIT" ]
permissive
/* ================================================================================================== Core - JavaScript Foundation Copyright 2010-2012 Zynga Inc. ================================================================================================== */ (function(global) { // Dynamic URI can be shared...
true
dc84bbf7ed009ff410e836af2ac3363fa8f9d3a8
JavaScript
AlePaa/fullstack2018-week5
/redux-anecdotes/src/App.js
UTF-8
1,140
2.671875
3
[]
no_license
import React from 'react'; import actionFor from './actionCreators' class App extends React.Component { addVote = (id) => () => { this.props.store.dispatch( actionFor.voteAdding(id) ) } createAnecdote = (e) => { e.preventDefault() const anec = e.target.anecdote.value if (anec !== '') ...
true
65a7792052f3a546e41f164c39d334cf2289687f
JavaScript
heliotherapyy/interviewCake
/IDeserve/MaximumAverageSubArray.js
UTF-8
725
3.75
4
[]
no_license
var arr = [11,-8, 16, -7, 24, -2, 3]; // O(n^2) var main = function(arr) { var cache = {}; for (var i = 0; i < arr.length; i++) { update(cache, arr, i); } console.log(cache); var maxRange = findMax(cache); return maxRange; } var update = function(cache, arr, start) { var sum = 0; for (var end =...
true
aa81c6c837ecac01e44cee386d294962448c7e4e
JavaScript
jcklpe/stopwatch-dev-test
/src/index.js
UTF-8
5,498
3.328125
3
[]
no_license
//- scss injection import "./styles.scss"; const autoBind = require(`auto-bind`); //- Global Variables let stopwatchIter = 0; const stopwatchGroup = []; const appDiv = document.getElementById(`app`); // define component markup const stopwatchMarkup = `<div class="timer-group"> <p class="time-display">0:00.00...
true
2a6e9facb0fde2d1bb34d0d1029fb85fc3faad9b
JavaScript
vimalkodoth/image-slider-vanillajs
/main.js
UTF-8
1,616
3.125
3
[]
no_license
(function(){ const defaults = {}; class Slider { constructor(options){ this.options = Object.assign({}, defaults, options); this.init(); } init(){ const that = this; this.carouselElm = document.querySelector('[data-target="carousel"]'); const itemElm = this.carouselElm.querySelector('[data-ta...
true
f1fa569a77127a4d5a64611500c84d20ef5b7021
JavaScript
smile-yi/Ydmin
/admin/src/common/Amap.js
UTF-8
1,003
2.640625
3
[]
no_license
//高德地图api export default { //坐标拾取器 setMarkerPosition : function(domId, origin, callback){ var map = new AMap.Map(domId, { resizeEnable: true, center: origin, zoom: 13 }); var marker = new AMap.Marker({ //添加自定义点标记 map: map, ...
true
4667152af1117b428b6039351dfd247ce4fd94f8
JavaScript
exoduz/envoy-guestlist
/src/guest-list-row.js
UTF-8
1,740
2.65625
3
[]
no_license
import React from 'react'; import PropTypes from 'prop-types'; /** * Output sign out options. * * @param {String} signOutStatus Current sign out status of the user. * @param {Number} id The id of the user. * @return {XML} */ const outputSignoutOptions = ( signOutStatus, id, onSignOut ) => { if ( ! ...
true
806325075c8f732f4f9b0f1ca36f7f84698739f1
JavaScript
tjx666/leetcode-javascript
/src/0190-Reverse Bits/reverseBits2.js
UTF-8
454
3.8125
4
[ "MIT" ]
permissive
/** * 题述:反转二进制位 * 思路:参考 0007-反转整数解法二 * 时间复杂度:1,固定循环 32 次 * 空间复杂度:1 * @param {number} n - a positive integer * @return {number} - a positive integer */ function reverseBits(n) { let ans = 0; let i = 32; while (i-- > 0) { ans = (ans << 1) + (n & 1); n >>>= 1; } // 将负数转换成对应的无符号正整...
true
70b5c5b29ba8215b0f229667adca7d1f507c2b96
JavaScript
ubumtu1987/home15
/routes/request.js
UTF-8
740
2.609375
3
[]
no_license
var db = require("../models"); module.exports = function(app) { app.get("/api/burgerQ", function(req, res) { // findAll returns all entries for a table when used with no options db.burs.findAll({}).then(function(dbTodo) { // We have access to the todos as an argument inside of the callback fun...
true
13bdeec826ad69e8e11d0801129253860ab2179c
JavaScript
HumbertoValenzuela/JS08-Arrays
/js/10-app.js
UTF-8
1,168
4.28125
4
[]
no_license
// 10 .map para iterar un array, y sus diferencias con forEach const multiples = [ { nombre: 'monitor', precio: 53200 }, { nombre: 'TV', precio: 32500 }, { nombre: 'LCD', precio: 37500 }, { nombre: 'LED', precio: 57800 }, { nombre: 'Audifonos', precio: 59300 }, { nombre: 'Parlantes', precio: 53...
true
3124aa0c58709ce055c5e421094cdae8f749ed7a
JavaScript
nbcuiux/new-portfolio
/wp-site/src/js/components/BodyClass.js
UTF-8
1,203
2.53125
3
[]
no_license
import React, { Component, PropTypes } from 'react'; import $ from "jquery"; class BodyClassManager { constructor() { this.classnames = {}; } add(classname) { let item = this.classnames[classname]; if (item === undefined) { this.classnames[classname] = 1; $("body").addClass(classname); } else { ...
true
93db6b5f8b566a5b5aeda3dbbe00f17c5fea5110
JavaScript
zhang1pr/AdventOfCode.js
/2017/15B.js
UTF-8
807
3.125
3
[ "MIT" ]
permissive
const fs = require('fs'); const input = fs.readFileSync(0, 'utf8').trim(); const readnum = (a) => (a.match(/\d+/g) || []).map(a => Number(a)); const readnum2d = (a) => a.split('\n').map(a => readnum(a)); const readword = (a) => a.split('\n'); const readword2d = (a) => a.split('\n').map(a => a.split(/\s+/)); function B...
true
a8d41e90c37c08a4fbaf886049720d89d2b2ea69
JavaScript
viniciussilvabarros05/NodeMongoDB
/controles/linkController.js
UTF-8
2,428
2.921875
3
[]
no_license
const Link = require("../models/Link") // IMPORTANDO MODELO DE LINK const redirect = async (req, res) => { let title = req.params.qualquercoisa //VAI PEGAR O VALOR QUE VEM DEPOIS DA BARRA "/:" try { let docs = await Link.findOneAndUpdate({ title: title },{$inc: {click:1}})// PRCURANDO NO BANCO DE DADO...
true
1626ce604bcffb83ef9d1dcd18e8ff42d7042737
JavaScript
Sykurpudar/TicTacToe
/src/logic/scoreBoard.js
UTF-8
371
3.265625
3
[]
no_license
//scoreBoard.js "use strict"; class ScoreBoard { // Scoreboard to keep scores for X and O while they play TicTacToe constructor() { this.xPoints = 0; this.oPoints = 0; } getXPoints() { return this.xPoints; } getOPoints() { return this.oPoints; } incrementX() { this.xPoints++; } incrementO() { ...
true
a087f1697f6ffa8cc6cb430e7392af8febb56051
JavaScript
BahPendragon/Serratec-2021
/Fase 4/TresAngulos.js
UTF-8
322
3.015625
3
[]
no_license
const ler = require("prompt-sync")(); var ang1 = ler("Digite o primeiro lado: "); var ang2 = ler("Digite o segundo lado: "); var ang3 = ler("Digite o terceiro lado: "); var validacao = ang1 <= ang2+ang3 || ang2 <= ang1+ang3 || ang3 <= ang1+ang2; console.log("Essas medidas tornam esse triângulo é válido?", validacao);
true
f28bac907e7f053dfd1437b57c0ecc817ae6da7c
JavaScript
164424-RoshanKanwal/Assignments
/JS assignment/register.js
UTF-8
596
3.0625
3
[]
no_license
function userInfo(){ var name = document.getElementById("name"); var email = document.getElementById("email"); var address = document.getElementById("address") var mobile = document.getElementById("mobile"); var cpassword = document.getElementById("cpassword"); var password = document.getElementById("password"); ...
true
93c2b80260ed166ff45b4e21ca0b0254b48ca394
JavaScript
karenlorhana/typescript
/type-annotation/numberType.js
UTF-8
711
3.359375
3
[]
no_license
"use strict"; // example 01 - number let num1 = 14.0; //number let num2 = 0x37FC; //hexadecimal let num3 = 0o377; //octal let num4 = 0b111001; //binario console.log("Number (ponto flutuante) - ", num1); console.log("Hexadecimal - ", num2); console.log("Octal - ", num3); console.log("Binário - ", num4); // example 0...
true
0604abb7ef02f7ce9c0fd8173a07e4a953ddb78d
JavaScript
Graphene-Dev/GrapheneBot
/commands/value.js
UTF-8
456
2.921875
3
[]
no_license
const Discord = require('discord.js'); module.exports.run = async (client, message, args) => { // gonna have to work on this command when there is actual value lol let val = getVal().toString(); return message.reply(`our value is currently $${val}.`); } function getVal() { // get the value from the ap...
true
ef584d49f03e80e9ec1fe2d72a11ea4b7f542d98
JavaScript
karleypetracca/surveyor-client
/src/components/CreateSurveySingleQuestion.jsx
UTF-8
4,561
2.859375
3
[]
no_license
import React, { useState, useEffect } from "react"; import RequiredText from "./RequiredText"; const CreateSurveyQuestion = (props) => { const { index, passData } = props; // setting initial single question state const [question, setQuestion] = useState({}); // setting individual field states const ...
true
c7d40d05bbe9c356c5d161562678f48aa830fe2e
JavaScript
MrLuo2020/EchartsStudy
/echarts/04_testSymbolSize_callBack/js/test2.js
UTF-8
1,784
2.828125
3
[]
no_license
window.onload = function () { var size = [16, 10, 20, 30, 48,50,40]; var myChart = echarts.init(document.getElementById("box1")); var option = { tooltip:{ trigger:'axis', formatter: '{a}<br>'+ '{b}:{c}' }, xAxis: { type: 'category'...
true
c2d26a1b827b34758f59a61454b7a4c7940ea6b8
JavaScript
mutheusalmeida/javascript-basic-projects
/11-tabs/app.js
UTF-8
563
2.859375
3
[]
no_license
const btnContainer = document.querySelector('.btn-container'); const btns = document.querySelectorAll('[data-id]'); const content = document.querySelectorAll('.content'); btnContainer.addEventListener('click', (e) => { btns.forEach(btn => { if (btn === e.target) { btn.classList.add('active'); } else { ...
true
00c3d3ac3ac0d6e878f6b8fd4b3d88f036488269
JavaScript
joshuaautawi/Glints-Academy-Jest
/js/reverse.js
UTF-8
147
2.578125
3
[]
no_license
function reverse(str) { return str.split("").reverse().filter(e=>e!=",").join("") } console.log(reverse('pi nk')) module.exports = reverse;
true
f1e13a74eb7a0fd9a5da07361ebc2bf17de77023
JavaScript
iamkjw77/JS_practice
/control_statement/Q08.js
UTF-8
136
3.109375
3
[]
no_license
function solution(){ let sum = 0; for(let i=0; i<20; i++){ if(i%2 && i%3) sum += i; } return sum; } console.log(solution())
true
70a39cffb837ca8b1621747b532a6dfdfb8ed99d
JavaScript
codingdojo-pna-july-2019/Anam_assignments
/Alogs/week1/array I/to_do3/remove_negatives.js
UTF-8
612
4.1875
4
[]
no_license
// Remove Negatives // Implement removeNegatives() that accepts an array, removes negative values, and returns the same array (not a copy), preserving non-negatives’ order. As always, do not use built-in array functions. function remove_Neg(arr) { for (var i = arr.length-1; i >= 0; i--) { if (arr[i] < 0...
true
bdc40a0ac6d4a19487cafd7306283a5a5b40c6cf
JavaScript
zhangloo333/DataStructNote
/Linklist/delet_node.jas.js
UTF-8
1,577
3.875
4
[]
no_license
/** * Created by lee on 9/10/17. */ function createLinklist(arr,n) { if(n == 0) return null; var head = new Node(arr[0]); var curNode = head; for(var i = 1; i < n; i++) { curNode.next = new Node(arr[i]); curNode = curNode.next; } return head; } function print(root) { ...
true
26f252f360ddd495f4f2014d2ef4a7594cd7d758
JavaScript
saturn597/simple-space-game
/src/basicBaddy.js
UTF-8
1,035
2.5625
3
[ "MIT" ]
permissive
import Phaser from 'phaser'; export default class BasicBaddy extends Phaser.Physics.Arcade.Sprite { constructor(scene, config, texture) { super(scene, config.x || 0, config.y || 0, texture || 'dropper'); this.name = 'BasicBaddy'; this.worldBounds = scene.physics.world.bounds; this...
true