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
a16e7f8af7d3ff134b1e05e3673b3c3b6b81c7d7
JavaScript
duncansultan/YellowPagesScraper
/models/SearchParam.js
UTF-8
560
3.234375
3
[]
no_license
/** Class representing a search parameter. */ module.exports = class SearchParam { /** * Create a search parameter. * @param {string} first - The first value. * @param {string} last - The last value. * @param {string} zip - The zip value. * @param {string} state - The state value. * @param {string} ...
true
ba7d43b121c3b812b428295691c421edd06e1c21
JavaScript
googlecorporation/admin-88
/workspace_sitoWeb/CommonGestWeb/WebContent/js/number.js
UTF-8
5,523
2.984375
3
[]
no_license
// =================================================================== // Author: Mestriner Paolo // // // NOTICE: You may use this code for any purpose, commercial or // private, without any further permission from the author. You may // remove this notice from your final code if you wish, however it is // appreciated...
true
cf7aab154d9485741f5979a096eeb929a7293dc1
JavaScript
matsbyfl/strava-fun
/backend/controllers/stravaFunApi.js
UTF-8
4,847
2.640625
3
[]
no_license
"use strict" var config = require("../config/config"); var jsonToCSV = require('json-csv'); var _ = require('lodash'); var Activity = require('../models/activity'); var metMapping = require("../config/metTable") var flatten = require('flat') var moment = require('moment') exports.health = function (req, res, next) { ...
true
aecf046374bf3faf9e5683b70e97ea0fbee83012
JavaScript
stocktonjenkins/final-creative-project
/public/js/review.js
UTF-8
2,029
2.9375
3
[]
no_license
/*global Vue*/ /*global axios*/ /*global swal*/ new Vue({ el: "#review", data: { reviewer: { review: '', firstName: '', lastName: '' }, reviews: [], }, methods: { async submitReview() { if(this.isNullOrEmpty(this.reviewer.r...
true
b300065c16452c4a84870f18fbc860d70bfad603
JavaScript
sonukedia55/sonukedia55.github.io
/others/javascript/apitester/src/utils/utils.js
UTF-8
1,022
2.78125
3
[]
no_license
export function createElement(obj,classList,childList,id) { const el = document.createElement(obj); classList = Array.isArray(classList) ? classList : [classList] if(classList && classList.length){el.className = classList.join(" ")} if(childList){ childList = Array.isArray(childList) ? childList : [childLis...
true
0b0960bd47b2345f2851c7e3b6fff6857b70fa2d
JavaScript
dujianwu123/2018learn
/lianxiti/基础知识/事件/事件的传播机制.js
UTF-8
2,189
3.78125
4
[]
no_license
/** * 事件的传播机制 * 冒泡传播:触发当前元素的某一个事件(例如点击事件)行为,不仅当前元素事件行为触发而且其祖先元素的相关事件行为也会依次被触发,这种机制 * 就是“事件的冒泡传播机制” */ // window.onclick = function(){ // console.log("window"); // } // document.onclick = function(){ // console.log("document"); // } // document.documentElement.onclick = function(){ // console.log("html"); // }...
true
ab1813df03b3f731e515c276e8c49856b6295e39
JavaScript
Codaisseur/assessment-worked-example-backend
/sampleRequests/updateHearts.js
UTF-8
382
2.625
3
[]
no_license
const axios = require("axios"); const { PORT } = require("../config/constants"); async function updateHearts() { try { const id = 2; const hearts = 9; const response = await axios.patch( `http://localhost:${PORT}/artworks/${id}`, { hearts, } ); console.log(response.data...
true
5f837141bc32629121392f873569e5c863428c38
JavaScript
BrianCambron/awesome-ugly-website
/scripts/main.js
UTF-8
775
2.59375
3
[]
no_license
const yesButton = document.querySelector('.yesbtn'); yesButton.addEventListener('click', function(){ alert('TO BAD!!!') }); const noButton = document.querySelector('.nobtn'); noButton.addEventListener('click', function(){ alert('YAY!') }); function changeImage() { if (document.querySelector(".pepe").src == "ht...
true
940b1a2ab0a5ed76afb9b445beb74d159d87a570
JavaScript
muhamed-didovic/functional-programming
/modules/24.js
UTF-8
1,314
3.75
4
[]
no_license
//Principled type conversions with Natural Transformations //We learn what a natural transformation is and see the laws it // must obey. We will see how a natural transformation must uphold // the law of nt(x).map(f) == nt(x.map(f)). //Natural Transformations is type conversation, it takes on functor to // another fu...
true
397c390966bda331c2b73239fc06513427853213
JavaScript
Chansen88/brucebot
/libs/groupMe.js
UTF-8
811
2.640625
3
[]
no_license
const https = require("https"); // const env = require('node-env-file'); // env(__dirname + '/../.env'); const botID = process.env.BOT_ID; function postMessage(botResponse) { return new Promise((resolve, reject) => { const options = { hostname: "api.groupme.com", path: "/v3/bots/post", method:...
true
f66d5b0ccddac474fc37d93071d2df0896552c14
JavaScript
clintzhu20/DataTypesJS
/src/ex/anagram.js
UTF-8
502
3.734375
4
[]
no_license
var anagram = function(word, caseSensitive){ if(typeof(word) !== "string"){ console.log("Your input should be a string") return false } let toTest if(caseSensitive){ word2 = word }else{ word2 = word.toLowerCase() } var spell = word2.split("") var ...
true
d2c17ddf98c907b1675b5d0e3c27cdeb3d1e31d2
JavaScript
piotrslowik89/ToDoApp
/src/containers/ToDoList/index.js
UTF-8
1,731
2.59375
3
[]
no_license
import React, { Component } from "react"; import ToDoItem from "../../components/ToDoItem"; import NewTodoForm from "../../components/NewTodoForm"; import styled from "styled-components"; const Container = styled.div` background: #2b2e39; margin: 0 auto; width: 80%; max-width: 600px; padding: 14px; border-...
true
0c59840c84ff2e8220837691a52d75eddd44f2a9
JavaScript
alextuti/reg-form-w-custom-validation
/main.js
UTF-8
2,570
3.21875
3
[]
no_license
document.addEventListener('DOMContentLoaded', function(event){ var ruleNames=[]; var forEach=Array.prototype.forEach; // Storing all the data-rules inside the array ruleNames var ruleElements=document.querySelectorAll('span[data-rule]'); forEach.call(ruleElements, function(element){ ...
true
0d1244f12c62646e2bf3ca9e072c86c112d58aa9
JavaScript
LooperShowcase/nicole-di-p5-2
/sketch.js
UTF-8
1,206
3.015625
3
[]
no_license
function setup() { // The size of our starting canvas: 400px width, 400px height createCanvas(500, 500); angleMode(DEGREES); } function preload() { img = loadImage("dog.png"); } function draw() { // The same as doing: background(220); or --> background(220,220,220); background("#f3e9dc"); ...
true
7c9448eb141aa4e18f53adffaeb4ada5c71ab041
JavaScript
holladayinnn/tommy-music-theory
/src/app/lessons/services/PlayExample.service.js
UTF-8
3,275
2.5625
3
[]
no_license
(function(){ angular.module('MyApp.Lessons') .service("PlayExample", function (AudioContext, Volume, frequencyList) { var self = this; self.myAudioContext = AudioContext.get(); self.type = 'triangle'; self.Interval = function (frq1, frq2) { var oscillator = self.myAudioContext.createOscillator(); var ...
true
62481691610241f7575f87d8923521108af08393
JavaScript
son-of-sokcho/for-github
/vanilaJS/index.js
UTF-8
1,170
3.96875
4
[]
no_license
const title = document.querySelector("#title"); title.innerHTML = "Click here!"; title.style.color = "white"; document.title = "I own you now"; function handleClick(){ title.style.color = "blue"; title.innerHTML = "Now, fuck off"; } const CLICKED_CLASS = "clicked"; function handleClick(){ title.classList.tog...
true
9d0186cd40a389a3a341478e2bd7ca3b8db41c80
JavaScript
TheHardSkills/notes-service
/src/components/App.js
UTF-8
547
2.546875
3
[]
no_license
import React from 'react'; import ControlPanel from './ControlPanel.jsx' let commandsArray = ["Get all notes", "Get specified note", "Create note", "Update note", "Delete note"]; //let commandsArray = ["Update note"]; function App() { return ( <div className="App"> <header className="App-header"> <p...
true
51e8e7827a6b7bfddc31ffbc8cc6427e2ae219d1
JavaScript
rjsalamanca/user-cards-bulma
/src/cardBio.js
UTF-8
458
2.546875
3
[]
no_license
import React from 'react'; const bioStyle = { borderTop: '5px solid #EFEEEF', listStyleType: 'none', textAlign: 'left', paddingInlineStart: 0 } const CardBio = props => { const { user } = props; return( <ul style={bioStyle}> <li><b>City:</b> {user.location.city}</li> ...
true
f1a1ed7e8f35f67346fac7cfc8cd2addc3e7d08b
JavaScript
hariria/perigo
/perigo/src/main/resources/static/browse/signin.js
UTF-8
5,058
2.578125
3
[]
no_license
function signUp(){ document.location.href = "../signup/signup.html"; }; function showSignIn(){ /* Revert and changes forgot password made */ $('#sign-in').animate({height: "650px"}, 0); $("#headerText").show(); $("#username").show(); $("#email").hide(); document.getElementById("usernameContainer").style.bor...
true
a32f70e13874a2f37c55ef0417d35e5081624e04
JavaScript
tobon0412/codereview
/src/js/utils.js
UTF-8
7,959
2.65625
3
[]
no_license
"use strict"; let request = require('request'); //let Response = require('./response.js') module.exports = { //TODO:Make it work /*Promises: function(type){ let newMessagePromise = new Promise( // The resolver function is called with the ability to resolve or // reject the promise f...
true
e6b2911a9e6f298f9746645581e7944961767c7d
JavaScript
darinchakalov/JavaScript-Fundamentals-2021
/Regular Expressions/1. Winning Ticket.js
UTF-8
1,287
2.96875
3
[]
no_license
function solve(input) { let pattern = /([@#$^]{6,10})/; let tickets = input[0].split(","); for (let ticket of tickets) { ticket = ticket.trim(); if (ticket.length !== 20) { console.log(`invalid ticket`); } else { let firstHalf = ticket.substring(0...
true
35059e3deadb2956817429222e8a6944b5549776
JavaScript
dMcGaa/image-search-abstraction-layer
/image-search-layer/util-image-search.js
UTF-8
842
2.828125
3
[]
no_license
function imageSearch(str) { var output = {}; var temp = getOffset(str); output.offset = temp.offset ? temp.offset : 10; output.searchTerms = searchTerms(temp.search); return output; } function searchTerms(str) { output = str.split(/\%\w{2}|\W/); return output; } function getOffset(str) { ...
true
d126757d9a3d621408c94f4e044c17a20d6145fa
JavaScript
zamir44/beca
/js/script.js
UTF-8
2,151
2.84375
3
[]
no_license
//*** STICKY NAVIGATION ***// const header = document.getElementById("menu-wrapper"); window.addEventListener( "scroll", (e) => { window.scrollY >= 100 ? header.classList.add("sticky") : header.classList.remove("sticky"); }, { passive: true } ); //*** THUMBNAIL MANIPULATION ***// const employ...
true
5dfd578f3f9345fe9a4a8ea4c535f58806f2cf21
JavaScript
AndyMukherjee/Shopping-List
/shop.js
UTF-8
430
2.515625
3
[]
no_license
$(document) .ready(function(){ $('.button') .click(function(){ var value = $(".input").val(); $('#shoplist').append("<li><input type='checkbox'>"+value+"<button class='button2'>Remove</button></li>"); $(".input").val(""); }); $('ul').on('click', 'li', function(event){ $(this).css("text-decoration","...
true
aed8010698d8efcef9946aa53cff21d5e685ca4f
JavaScript
anastasiabatura/monday_site
/js/script.js
UTF-8
2,745
2.65625
3
[]
no_license
$(function() { /* Navigation Scroll to id*/ $(".main-nav a, .read-more ").mPageScroll2id({ offset : -30, scrollSpeed : 1000, scrollingEasing: "easeInOutCirc" }); /**************** Form Submit *******************/ var textFields = $("#gform input[type='text']"); var regExp = { firstName : /^[а-яА...
true
98ad60a2fc03988ecec62b45fd6bfe6ae22b2e6f
JavaScript
vanshianec/Javascript-Advanced
/JQuery/Exercises/2.timer.js
UTF-8
629
2.9375
3
[]
no_license
function timer() { let timer; let count = 0; let ticking = false; $('#start-timer').on('click', function () { if (!ticking) { timer = setInterval(step, 1000); ticking = true; } }); $('#stop-timer').on('click', function () { clearInterval(timer); ...
true
f407c4e5f97d6c3c991bd8565cc47031838bc8c4
JavaScript
mleitejunior/doe
/server.js
UTF-8
1,999
2.8125
3
[]
no_license
// Server configuration const express = require('express'); const server = express(); // Enable form body server.use(express.urlencoded({ extended: true })) // Static files configuration server.use(express.static('public')); // Postgress Connection const Pool = require('pg').Pool; const db = new Pool({ user: 'po...
true
5c6b74ac5ae41a0ab915148ff21b2f75f5fb4c12
JavaScript
burend/ASFA
/Javascripts/Source/People/personPamela.js
UTF-8
29,567
2.6875
3
[]
no_license
/**************************************************************** Pamela (Church Wall Girl) ****************************************************************/ function RepliesPamela(nR) { var pCharm = per.isCharmedBy(); var myName = per.getYourNameFor(); if (nR == 13901) { per.setFlag(2); if (!pCharm) //NOT ch...
true
0b9d07bb6acf0b1670da1340296edf16588716f0
JavaScript
barbaralang/coursera-js
/module1_solution/app.js
UTF-8
950
2.5625
3
[]
no_license
(function () { 'use strict'; angular.module('LunchCheck', []) .controller('LunchCheckController', LunchCheckController); LunchCheckController.$inject = ['$scope']; function LunchCheckController($scope){ var enjoy = 'Enjoy!'; var much = 'Too much!'; var emptyData = 'Please enter...
true
28fdb185d2b4b40809cc390403cb37d7e0abbd69
JavaScript
muktek/starter-repo--jsdom-intro-to-events
/js/01-event-anatomy.js
UTF-8
476
3.015625
3
[]
no_license
// A - anatomy of event listener (pop alert) //------------------------------------------- //(1) select dom element that receives event (the listening element) //(2) declare what will happen (the event-handler function) //(3) add the event listener to the element that will receive the event, // « elemenet ».add...
true
feaab240eeb40c7673f00e52c0e4a8d41f1c38f3
JavaScript
mattiegraf/forum-database
/db-app/client/src/Subforum.jsx
UTF-8
1,645
2.609375
3
[]
no_license
import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import {Error} from './Error.jsx'; class Subforum extends Component { constructor(props) { super(props) this.state = { subforums: [], threads: [] } this.match = props.match; } componentDidMoun...
true
7fd98db906ecd2f954eccda39bb907ebe1dc40a4
JavaScript
WhiteheadAaron/improved-bookmark-app
/scripts/store.js
UTF-8
766
2.65625
3
[]
no_license
'use strict'; /* global */ // eslint-disable-next-line no-unused-vars const store = (function () { const findById = function(id) { return this.items.find(item => item.id === id); }; const addItem = function(item) { this.items.push(item); }; const findAndDelete = function(id) { this.items...
true
30432be1679337a952e54b85746657d2db9b0aca
JavaScript
EliottGdl/Javascript
/Bomberman/perso.js
UTF-8
2,192
3.234375
3
[]
no_license
class Perso { constructor(x,y,w,id){ this.x = x; this.y = y; this.w = w; this.nbBomb = 1; this.pBomb = 2; this.vx = 0; this.vy = 0; this.acc = 3; this.id = id; this.vivant = true; } show(){ push(); strokeWeight(2); if(this.vivant){ if(this.id==1){ ...
true
ba46522a8ff14bb7dece69c739c8ed407f29d466
JavaScript
benaghaeipour/line-chart
/test/scales.spec.js
UTF-8
3,518
2.765625
3
[ "MIT" ]
permissive
describe('scales', function() { describe('logarithmic y axes', function() { beforeEach(function() { scope.$apply(function() { scope.data = [{x: 0, value: 4}, {x: 1, value: 8}]; scope.options = { axes: { y: {type: 'log'} }, series: [ {y:...
true
577edca94d52bcb74fb978f0426406f3f9c84277
JavaScript
ssh382736/nodejspoc
/string字符串的练习.js
UTF-8
312
3.640625
4
[]
no_license
'use strict'; //字符串方法练习 var s = 'Hello'; console.log(s.length); s.toUpperCase //全部变成大写 s.toLowerCase //全部变成小写 /** * 某个字符第一个出现的角标 */ var index = s.indexOf('l'); console.log(index); /** * 截取字符串 */ console.log(s.substr(0,2));
true
ede10b157f910ad76b0761f331d383afef5d8c62
JavaScript
Ahmedomar747/Nagwa-task
/nagwa-test.js
UTF-8
1,858
3.09375
3
[]
no_license
$(document).ready(function() { var launched = false; var radius = 0; var angle = $('#angle').val(); var velocity = $('#velocity').val(); let canvas = document.getElementById("canvas"); canvas.width = $(".view").width(); canvas.height = $(".view").height(); let ctx = canvas....
true
b13a868f6af1bfcd18734e1468b8929be42f73f1
JavaScript
jutionck/belajar-javascript
/DAY#3/classJs.js
UTF-8
259
3.78125
4
[]
no_license
class Person { constructor(name, age) { this.name = name; this.age = age; } walk() { console.log(`${this.name} berjalan menggunakan kaki`); } } let jution = new Person("Jution", 25); console.log(jution) jution.walk()
true
49bb11d79cb93f5ac755a1f53056911c60170d73
JavaScript
aaronblythe/selenium-builder
/seleniumbuilder/content/html/seleniumbuilder3.js
UTF-8
13,395
2.515625
3
[ "Apache-2.0" ]
permissive
// Establish sebuilder namespace. var sebuilder = {}; /** The tab node that is highlighted green (can be used to get a reference to the content). */ sebuilder.recordingTab = null; /** The window we're recording in, if different from the one in the recordingTab. */ sebuilder.customRecordingWindow = null; /** The windo...
true
66ba9c2ce390dc7e6c1eb7d96f875275340807e4
JavaScript
plasma-dag/plasma-client
/tests/miner_test.js
UTF-8
2,262
2.578125
3
[]
no_license
"use-strict"; const { Miner } = require("../src/miner/miner"); const { Blockchain } = require("../src/core/blockchain"); const { StateObject } = require("../src/core/state"); const { Database } = require("../src/db/index"); const { Account } = require("../src/core/account"); const { Potential } = require("../src/core/p...
true
d35321042c713cabec9c2bbf1e47e1bb003164ca
JavaScript
PaulBratslavsky/NodeJS-IntroToNode
/models/UserModel.js
UTF-8
1,840
3.296875
3
[]
no_license
const validator = require('validator'); let User = function(data) { this.data = data this.errors = []; } User.prototype.cleanUp = function() { if (typeof(this.data.username) != "string") { this.data.username = ""; } if (typeof(this.data.password) != "string") { this.data.password...
true
b4c1ee32201f5169036886a675ce51adfd8aa6db
JavaScript
QxQ/evacle-extensions
/pinner/code/background.js
UTF-8
3,087
2.5625
3
[]
no_license
//-- some easaly changed variabled --// _changeIcon = true //change this variable to false if you don't like the icon changing. (default true, may change to false in the future) if (!_changeIcon) { //changed default icon to logo if _changeIcon is false chrome.browserAction.setIcon({path:'pin_without_tab.png'}) } //-...
true
c1875447d3d6e905d7401473278e8f6ea17a6da6
JavaScript
nghiatrvn/testGK
/testGK/test1.js
UTF-8
336
3.234375
3
[]
no_license
let arr = ["MJMAM", "IOT", "ONEPO", "SAMBA"]; function test(text) { for (let i = 0; i < text.length / 2; i++) { if (text[i] === text[text.length - i - 1]) { return true; } else { return false; } } } for (let i = 0; i < arr.length; i++) { console.log(tes...
true
6dd8ce00f94f68bbc67abd7c305d40359870f32a
JavaScript
beyzabayrakdar/fenerium_vuex
/test/Expectation.test.js
UTF-8
655
3.171875
3
[]
no_license
describe('expectations', () => { test('Math Test', () => { // Use .toBe for simple comparisons expect('Some String').toBe('Some String') expect(13).toBe(13) expect(1 + 2).toBe(3) // Use .toEqual when comparing complex types expect({ type: 'array' }).toEqual({ type: '...
true
d4810a569a4cbac5dd6d6adc96e3b45e103cff5f
JavaScript
Alexmurder/readNov
/js/PUGE-0.2.js
UTF-8
2,715
3.3125
3
[]
no_license
/** * Created by PuGe on 2016/7/24. */ //返回值 String //字符串截取(原字符串,截取起点,截取终点(可选),起始位置(可选) //例:cut_string("123你好145你好","1","好",1)返回值为 45你 function cut_string(Original,Before) {return Original.substring(Original.indexOf(Before) + Before.toString().length)} function cut_string(Original,Before,After){if(Before!=null){var...
true
f40dc975f770ae0787e0b8e476334a2c222241e9
JavaScript
vicdrose/VueDrakeQuotes
/js/index.js
UTF-8
2,981
2.828125
3
[]
no_license
$(window).load(function() { // Giphy Image loader var GiphyImgLoader = (function() { var _gifs = [], _apiKey = "dc6zaTOxFJmzC", _apiRoot = "http://api.giphy.com/v1/gifs/"; function getQueryURL(query) { return _apiRoot + "search?q=" + query + "&api_key=" + _apiKey; } function saveApiRespons...
true
a72554024504b777584d600e8c0bbca38f360650
JavaScript
hc-fe-baidu/BD.ES
/ES6/extend/extend.prototypeChain-call.js
UTF-8
1,113
4.09375
4
[]
no_license
// 原型链维护 + 修改 this 指向的继承方式 // 优点: 能够拥有比较优良的设计: 属性私有, 操作共有. 具体来讲就是类的操作放在原型中, 为所有对象共有, 属性放在构造中, 实例化的时候各个对象私有. // 配合修改 this 指向获取构造成员. // 已经是基本的继承了. 操作共享. // 缺点: 需要维护比较多的依赖, 需要维护一个多余的父类对象 // 需要配合 call 或者 apply 去获取构造成员. 否则只能把属性也提到原型级别[不可取]. // 操作繁琐: 细节暴露. // 子类强依赖父类. // 父类构造里维护了一套和子类相同的属性 function Person(name = '', age = ...
true
03c16020fe978be19000e8e152842ef2fab06d85
JavaScript
JacobASmith/VEGA
/app/assets/javascripts/feedback.js
UTF-8
3,209
2.703125
3
[]
no_license
function deleteFeedback(pathnamefeed, feedbackfeed, list){ let jwt = window.localStorage.getItem("jwt") let name = window.localStorage.getItem("username") let del = axios.delete('http://localhost:3000/private/'+name, {headers: { Authorization: "Bearer " + jwt }}) // console.log(list) let left...
true
a14e3131fd4ec6d0333f29f35903f6b7463345d2
JavaScript
demiladebamgbose/demiladebamgbose.github.io
/js/helper.js
UTF-8
806
2.828125
3
[]
no_license
function registerClickEvent(id, callback){ getId(id).addEventListener('click', callback, false); } function registerDropEvents(id,callback){ getId(id).addEventListener('drop',callback,false); } function rightLen(password){ if(getId(password).value.length >= 7){ return true; } return false; } function isValidD...
true
62dc6eb13083246e9745677ec21ffc02752e37ee
JavaScript
JPT580/dashboard
/src/Session.api.js
UTF-8
2,929
2.515625
3
[]
no_license
var scrypt = require("scrypt"); var tools = require("./Tools.js"); var constructor = function(db) { var db = db; var handler = function(req, res) { res.setHeader("Content-Type", "application/json"); //refresh session and return login status if(req.method == "GET") { if(req.session.data.login == true) { ...
true
a321e4785851d15ac7949e2d761eae5ccfcb4622
JavaScript
Mohsin41/delivery
/backend/src/models/product.js
UTF-8
4,005
3.03125
3
[ "MIT" ]
permissive
const mongoose = require('mongoose') const autopopulate = require('mongoose-autopopulate') const productSchema = new mongoose.Schema( { image:{ type:String, }, name: { type: String, unique: true, }, weight: { type: Number, }, //just for now to to check working of a function ...
true
a1ddddfe443f8446f8d04083a7953c734a3bedb5
JavaScript
manojsatwase/manojsatwase.github.io
/random-quote/js/app.js
UTF-8
1,482
3.25
3
[]
no_license
(() => { const quote = document.querySelector("#quote"); const quoteAuthor = document.querySelector(".quote-author"); const btn = document.querySelector("#quote-btn"); const quotesList = [ { text: "Design is not for philosophy it's for life.", author: "- Issey Miyake -" }, { text: ...
true
855dcc1c92dd399f26287be9eed51cb619d90a9a
JavaScript
mechanismsjs/mech-async
/testsweb/tests/async.js
UTF-8
1,162
2.640625
3
[]
no_license
// README: // Must $ gulp webserver then browse to // http://test.development.com:4050 or Access-Control-Allow-Origin exception is thrown describe("running web specific tests", function() { beforeEach(function() { for (var key in m.cellWorkBook) { if (m.cellWorkBook.hasOwnProperty(key)) { delete ...
true
17f876d11ae39cedf9fed84b5dc1dae52dd7043f
JavaScript
MikitaZelikov/final-project-react
/src/localStorage/storage.js
UTF-8
2,138
2.640625
3
[]
no_license
// for save sort option export function setCurrentSortOption(sortBy) { sessionStorage.setItem('currentSortOption', sortBy); } export function getCurrentSortOption() { return sessionStorage.getItem('currentSortOption'); } // for paginator export function setCurrentPageNumber(page) { sessionStorage.setItem('curre...
true
bff9561e0251d01a75779510675c1856191ddf35
JavaScript
Turfjs/turf
/packages/turf-line-split/index.js
UTF-8
7,113
2.765625
3
[ "MIT" ]
permissive
import rbush from "@turf/geojson-rbush"; import square from "@turf/square"; import bbox from "@turf/bbox"; import truncate from "@turf/truncate"; import lineSegment from "@turf/line-segment"; import lineIntersect from "@turf/line-intersect"; import nearestPointOnLine from "@turf/nearest-point-on-line"; import { getCoor...
true
597acbbbd73b073be1efa17bee28fafd83406699
JavaScript
Lucas-Wong99/sum-all-number-in-array-test-js
/index.js
UTF-8
261
3.34375
3
[]
no_license
function sumItems(array) { // Sum all the numbers in the array let results = 0; for (const i of array) { if (Array.isArray(i)) { results += sumItems(i); } else { results += i; } } return results; } module.exports = sumItems;
true
b82bd9825c2a654f3b35b74047e30eed337b802e
JavaScript
nrobinaubertin/js-stuff
/spaceship/game.js
UTF-8
3,232
3.34375
3
[]
no_license
function dump(obj) { var out = ''; for (var i in obj) { out += i + ": " + obj[i] + "\n"; } alert(out); }; /************************************************** ** GAME VARIABLES **************************************************/ var canvas, // Canvas DOM element ctx, // Canvas rendering context keys, // K...
true
7497b56c6ebbb31d26072069f55c170b2a50a595
JavaScript
javiash/Ecommerces-master
/front/src/store/reducer/cart-reducer.js
UTF-8
409
2.53125
3
[]
no_license
import { SET_CART, ADD_CART } from '../constants'; const initialState = { cart: [], }; export default function (state = initialState, action) { switch (action.type) { case SET_CART: { return Object.assign({}, state, { cart: action.cart }); } case ADD_CART: { return Object.assign({}, state,...
true
dc74fe05933ebb63e1829ead998cbd89a664a364
JavaScript
Dyzio18/game-in-marbles
/src/common/randomBalls.js
UTF-8
1,005
2.578125
3
[]
no_license
import {state} from '../controllers/gameController'; import Color from '../components/Colors'; import Ball from '../components/Ball'; import scoreView from '../views/scoreView'; import viewController from '../controllers/viewController'; // TODO: // Add panel with balls in next round const randomBalls = (count) => { ...
true
2acbec8984e51519504ef1f81ba270372d096f11
JavaScript
yaphtes/javascript-api
/Algorithms/searching/linear-search/linear-search.js
UTF-8
519
3.203125
3
[]
no_license
/* Линейный поиск прост в реализации, он имплементируется под капотом большинства методов JavaScript применяется, в основном, к неотсортированным структурам данных. Сложность алгоритма O(N²). */ function linearSeacry(arr, value) { for (let i = 0; i < arr.length; i++) { const item = arr[i]; if (item ===...
true
0e3617ff4d0d8f208b0abe4edeeef0ee08281435
JavaScript
jinghua000/shadow-fns
/lib/F.js
UTF-8
402
2.921875
3
[ "MIT" ]
permissive
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; /** * Always return `false` * * @param {*} _ * @return {Boolean} * @since 0.1.0 * @category Logic * @sign x -> Boolean * @see T * @example * * f.F() // => fasle * f.F(10) // => fasle * f.F(null) //...
true
f83fd476dd91250543b0eaef6c0456b0222de1c1
JavaScript
ansariomar/hw3
/taller-lines.js
UTF-8
155
3.03125
3
[]
no_license
function setup() { createCanvas(400, 400); } function draw() { var y = 1; for(x=10; x<width-10;x+=5) { y = y + 10 line(x,0,x,y); } }
true
99b77a823600b0e9be2fae48aaff01379401ad7c
JavaScript
ibm-developer/generator-ibm-java
/generator-java/lib/common/lib/defaults.js
UTF-8
1,330
2.5625
3
[ "Apache-2.0" ]
permissive
/* * © Copyright IBM Corp. 2017, 2018 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
true
268efbb52597dd0cb6c96e259cf17759ffe8cd52
JavaScript
FilmWalrus/MazeMaven
/js/MazeGen.js
UTF-8
3,131
3.25
3
[]
no_license
function MazeGeneration() { var mazeElement = document.getElementById("maze-grid"); // Generate a grid for (var row = 0; row < gridHeight; row++) { var rowTileArray = new Array(); for (var col = 0; col < gridWidth; col++) { var square = document.createElement("label"); ...
true
726491ebcfefdc2074993a74ade3240308b0e9fa
JavaScript
AroniKyama/github-local
/JSFundamentalLearnings/basicJS5.js
UTF-8
839
3.1875
3
[]
no_license
function start(){ document.getElementById("resultButton").addEventListener("click",findAreaAndPerimeter,false); document.getElementById("changeButton").addEventListener("click",changeStyle,false); } function findAreaAndPerimeter(){ var side=document.getElementById("sideTextbox").value; //side=parseInt(side); if ...
true
c10759b75e10dee4ca93d7851701379e749b4499
JavaScript
NilsEngelbach/FlappyBirdsAI
/game/ground.js
UTF-8
405
2.546875
3
[ "MIT" ]
permissive
export default class Ground { constructor(canvas) { this.canvas = canvas; this.width = this.canvas.width; this.height = 110; } show(p) { p.image(p.groundSprite, 0, this.canvas.height - this.height); p.groundSprite.resize(this.canvas.width, 0); } collided(p) { if (p.y + p.size / 2 >= ...
true
717986ed57283549319e3910030bea9919417c91
JavaScript
ibrayo1/GaitAn
/public/js/game.js
UTF-8
9,045
2.796875
3
[]
no_license
let game; // global game options let gameOptions = { platformStartSpeed: 350, spawnRange: [100, 300], platformSizeRange: [100, 250], playerGravity: 900, jumpForce: 400, playerStartPosition: 200, jumps: 2 } window.onload = function() { // object containing configuration options ...
true
c01a6dcfd923bbd0a68e839acb0ddfcdb1e9ff50
JavaScript
hirolabpro/javascript-arrays-exercises-tutorial
/exercises/15-Max-integer-from-array/app.js
UTF-8
285
3.3125
3
[]
no_license
var myArray = [43,23,6,87,43,1,4,6,3,67,8,3445,3,7,5435,63,346,3,456,734,6,34]; let element=0; for (let index = 0; index < myArray.length; index++) { if (myArray[index]>element) { element = myArray[index]; } } console.log(element);
true
4b86036175f3670f7ff960c33523d268cbddcce0
JavaScript
wlh18/node-1-lecture
/server/index.js
UTF-8
430
2.546875
3
[]
no_license
const express = require('express') const controller = require('./controller') const app = express() const PORT = 4000 app.use(express.json()) app.get('/', (req, res) => { res.send('Welcome my friend to port 4000') }) app.get('/api/users', controller.getAllUsers) app.get('/api/users/:id', controller.getOneUser) ap...
true
fe48c3c4b2b5a9c0f04d1d7cb7d4201901a51665
JavaScript
Pawindevil/ciutn
/6-InstruccionFor/jsIteracionesFor (5).js
UTF-8
168
2.6875
3
[]
no_license
function mostrar() { var num=-1; var i=0; for (i=0; ;i++){ num=parseInt(prompt("ingrese numero")); if(num==9){ break; } } }//FIN DE LA FUNCIÓN
true
fb8b4cdb90ce7a466713a1d751f2eaf7302d4384
JavaScript
israelhm/CURSO-NODE-TABLA
/developer/node/curso/03-bases-node/app.js
UTF-8
654
2.71875
3
[]
no_license
//const { demandOption, number, describe, options, boolean, require } = require('yargs'); const {crearArchivo }= require('./helpers/multiplicar'); const argv = require('./config/yargs'); console.clear(); console.log(process.argv); // este muestra los argumentos de la consola de argv //console.log(argv); // este ...
true
cc2d14c8d106e981dcbe799f7ac71959aa64832d
JavaScript
upupming/algorithm
/leetcode/残酷刷题/2547. Minimum Cost to Split an Array.js
UTF-8
744
3.296875
3
[ "MIT" ]
permissive
/** * @param {number[]} nums * @param {number} k * @return {number} importance[i][j] count[i][j] */ var minCost = function(nums, k) { const n = nums.length const ipt = Array(n).fill(0).map(() => Array(n)) for (let i = 0; i < n; i++) { let cnt = Array(n).fill(0) let tmp = 0 for (let j = i; j...
true
736d66aae5c41640cefccd61a27e63cb45b988ad
JavaScript
Laeeth/vdx
/src/transforms/audio-filters/__tests__/speed.js
UTF-8
1,026
3.21875
3
[ "MIT" ]
permissive
const test = require('tape') const speed = require('../speed') test('is a function', function (t) { t.plan(1) t.true(typeof speed === 'function') }) test('returns `undefined` if called without arguments', function (t) { t.plan(1) t.true(typeof speed() === 'undefined') }) test('parses 0.2x speed', function (t...
true
0be2c084499c2586f479cc01b5a4b4626ea0bf79
JavaScript
dozoisch/react-prop-types
/src/mountable.js
UTF-8
725
2.984375
3
[ "MIT" ]
permissive
import {errMsg, createChainableTypeChecker} from './common'; /** * Checks whether a prop provides a DOM element * * The element can be provided in two forms: * - Directly passed * - Or passed an object that has a `render` method * * @param props * @param propName * @param componentName * @returns {Error|unde...
true
80e9cfcd24aaf94f3632aa92a99ffd1c5b5c400a
JavaScript
JamesSmall/AjaxTesting
/StackVQueue.js
UTF-8
3,497
3.09375
3
[]
no_license
"use strict"; var stackPanel; var queuePanel; var SINGLE_NODE = '{"data":null, "next":null}' var queue = { "head":null, "tail":null, "add":function(item){ var newNode = JSON.parse(SINGLE_NODE); newNode.data = item; if(queue.head === null){ queue.head = newNode; queue.tail = newNode; } e...
true
3589c63b0ad3ec58f52110a9dfdd1eb5ee339725
JavaScript
Eugenia-gal/Team-project-Filmoteka
/src/js/get-movies-by-keyword.js
UTF-8
3,304
2.828125
3
[]
no_license
/* Функция получает и рендерит первую страницу фильмов по ключевому слову */ import { refs } from './refs'; import movieCard from '../templates/movieCard.hbs'; import { createWarningMessageEl, showWarningMessage, hideWarningMessage } from './warning-msg.js'; import FilmsApiService from './class-fetch'; import { getM...
true
62190bda4165017f17383dc216e3f936e48f8b21
JavaScript
marygoldspink/reactnd-project-myreads-starter
/src/BookList.js
UTF-8
1,649
2.578125
3
[]
no_license
import React from 'react'; import { Link } from 'react-router-dom' import BookShelf from './BookShelf.js'; // This is a functional React component to render the book shelves // We use array sorting and filtering to choose which books to show in each shelf // we fire the handleShelfMove up to the parent component to mo...
true
b5aaa076a5bfdefe340b18a8f8921dcc77e61ba4
JavaScript
p-g1/Codewars-Published-Kata
/Small_Enough_Beginner/Small_Enough_Beginner.js
UTF-8
467
3.890625
4
[]
no_license
// Kata: https://www.codewars.com/kata/57cc981a58da9e302a000214 /* Description: You will be given an array (a) and a limit value (limit). You must check that all values in the array are below or equal to the limit value. If they are, return true. Else, return false. You can assume all values in the array are numbers...
true
1ff6c68b6644f2796098aaea1308328cc4d16e11
JavaScript
Diablillowilly/ogameStats
/html/map.js
UTF-8
17,365
2.84375
3
[]
no_license
//https://stackoverflow.com/questions/5736398/how-to-calculate-the-svg-path-for-an-arc-of-a-circle function polarToCartesian(centerX, centerY, radius, angleInDegrees) { var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0; return { x: centerX + (radius * Math.cos(angleInRadians)), y: centerY + (rad...
true
ee1f4173694b7606ce65663eb770a7fe6184f6f0
JavaScript
anovis/flightdealscrapper
/react-flightscrapper/src/Subscriptions.js
UTF-8
1,593
2.5625
3
[]
no_license
import { ListGroup,ListGroupItem, Button } from 'react-bootstrap'; import React, { Component } from 'react'; var axios = require('axios'); export default class Subscriptions extends React.Component { constructor(props) { super(props); this.state = {email: '', subscriptions: []}; this.h...
true
cd90dcf3644f308cf6f75fcb3a6c221e22e15177
JavaScript
VictorAw/VictorAw.github.io
/app/models/shapes.js
UTF-8
8,023
2.953125
3
[]
no_license
class RenderMesh { constructor(canvasCtx, vertices, itemCount, coordinates, rotationData, scale, colors, arrayType, // TRIANGLES, TRIANGLE_STRIP indices = [], hasElements = false, ...
true
6e037a0591e05e3fd7500fa7bbd79a15d8fe4d10
JavaScript
muyake/muyake.github.io
/canvas/animation/quxiantu/example.js
UTF-8
10,159
2.875
3
[]
no_license
/* * Copyright (C) 2012 David Geary. This code is from the book * Core HTML5 Canvas, published by Prentice-Hall in 2012. * * License: * * 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...
true
71d189b0ab29159255c6c8ec0438e9a69863dd56
JavaScript
melperez19/liri-node-app
/liri.js
UTF-8
6,780
2.984375
3
[]
no_license
require("dotenv").config(); // --------------------------Variables for accessing other files and API Keys------------------------------------------- //creates log.txt file to store retrieved information var filename = './log.txt'; var request = require("request"); var keys = require("./javascript/keys.js"); var fs = ...
true
d38f01f08b83f8b93eec1dad220209a93cb65017
JavaScript
keegoo/trigger
/client/src/components/panel/GaugeContainer.jsx
UTF-8
1,824
2.53125
3
[]
no_license
import React from 'react' import PropTypes from 'prop-types' import * as utils from './../utils.js' import Gauge from './Gauge.jsx' const styles = { layout: { display: 'grid', gridGap: '15px', gridTemplateRows: '1fr 1fr 1fr' } } class GaugeContainer extends React.Component { constructor(props) { ...
true
1ea818c519c1acdc8ffc90d9da13af88ac8aee6f
JavaScript
yuriyvyatkin/ahj-hw-3.1-mole-game
/src/js/Handlers.js
UTF-8
809
2.65625
3
[]
no_license
export default class Handlers { constructor(dead, gameField) { this.dead = dead; this.gameField = gameField; } assign() { for (const hole of this.gameField.querySelectorAll('.hole')) { hole.onclick = () => { if ( !hole.className.includes('disabled') && hole.className...
true
40839cad17f305e3bd66de05e57e57c835a07dc9
JavaScript
dustyo-O/bem-express-pepo
/libs/bem-history/common.blocks/location/location.js
UTF-8
4,133
2.75
3
[]
no_license
/** * @module location */ modules.define( 'location', ['inherit', 'events', 'history', 'objects', 'uri'], function(provide, inherit, events, History, objects, Uri) { /** * @class BEMLocation * @augments events:Emitter * @exports location */ var BEMLocation = inherit(events.Emitter, /** @lends BEMLoc...
true
068dd8740da19f40ec6d35b3d919297b0df96c1b
JavaScript
mariabp/GDL002-md-links
/test/for-testing.js
UTF-8
1,140
2.546875
3
[]
no_license
module.exports = { directoryFileList: [], linksCollection: [ ], parsedLinksCollection: [], validatedLinksCollection: [], brokenLinksCollection: [], uniqueLinksCollection: [] }; const getBrokenLinks = (validatedLinksCollection) => { let validStatusCodes = [200, 301, 302]; validatedLinksCollection.forEach((...
true
ca054f5e239975918a18311ff950d8d17471fd1a
JavaScript
Rohit211098/Club-Managment-System
/public/js/faculty-profile.js
UTF-8
10,534
2.765625
3
[]
no_license
var inputs = document.getElementsByName('profileImage'); for (var i = 0, len = inputs.length; i < len; i++) { input = inputs[i]; input.onmouseover = function(){ this.setAttribute('data-orig-image',this.getAttribute('src')); this.src = this.getAttribute('data-alt-image'); }; input.onmo...
true
f56c01c162536c9af5b136fa46643252f5173b49
JavaScript
AndreyMalykhin/TimeTrackingTool
/src/models/time-entry-service.js
UTF-8
1,008
2.5625
3
[]
no_license
export default class TimeEntryService { constructor(fetcher) { this._fetcher = fetcher; } getByUser(userId, startDate, endDate) { const params = encodeURIComponent(JSON.stringify( {userId, from: `"${startDate}"`, to: `"${endDate}"`})); return this._fetcher.fetch( ...
true
6dc3f74450b94638ed32235cdb4c9f2fc7041ebb
JavaScript
Michelle-M/EjerciciosJS
/8 - DOM/Ejercicio 13/index.js
UTF-8
395
3.375
3
[]
no_license
var body = document.querySelector('body'); console.log(body); var array = ['Sati', 'Luna', 'Leon', 'Morena', 'Zeca', 'Mishka', 'Dali', 'Bigotes', 'Manchita', 'Patitas']; var ul = document.createElement('ul'); console.log(ul); body.appendChild(ul); for ( var i = 0; i < array.length; i++ ) { var li = document.crea...
true
cf692193753f4210f7fb5b44969793e8e475619f
JavaScript
anlan404/PurposeLearn
/src/main/resources/web/js/10_1_同步异步.js
UTF-8
15,224
3.640625
4
[]
no_license
/** * 浏览器是多线程的 * + GUI渲染线程 * + HTTP网络线程 * + JS代码渲染线程 单线程 * ... * 浏览器只分配一个线程来处理js代码 * + js代码大部分的都说‘同步编程’ * + 但是js利用浏览器的多线程机制,可以规划出‘异步编程效果’ * + 定时器 * + ajax/fetch/跨域 * + 事件绑定 * + Promise * + Generator/yield * + async/await * ... * * * EventLo...
true
ad8371d6bcf436ed4fea3bc94a719fcc80bf73b6
JavaScript
dragonflypl/web-wiki
/angular-2-wiki/TeachingTaskWithIonic/LearningProcessing-p5.js/chp17_strings/exercise_17_05_display_coordinates/sketch.js
UTF-8
472
3.640625
4
[]
no_license
// Learning Processing // Daniel Shiffman // http://www.learningprocessing.com // Exercise 17-5: Take the bouncing ball example from Chapter 5. // Display the X and Y coordinates as text next to the ball. // This answer also incorporates movement along the y-axis, as // well as object orientation var b; function se...
true
131226cdb9033a96a6afcb16c7f53eb1c9a42a0c
JavaScript
idhong/git-webhook-ci
/lib/cli.js
UTF-8
1,257
2.625
3
[ "MIT" ]
permissive
'use strict'; /** * Run from cli * dir: '', * path: '/webhook', * port: 8081, * branch: 'refs/heads/master', * cmd: 'git pull origin master --no-edit' */ const gitWebhook = require('./index'); const meow = require('meow'); const cli = meow( ` Usage $ node startup.js <path> $ node startup.js <p...
true
08b4c52e2b7c10e37c59bde632daa3e315bf8b3c
JavaScript
legraeff/ice-cream-page
/js/index.js
UTF-8
564
2.9375
3
[ "MIT" ]
permissive
var $iceCreamList = $('.ice-cream-card'); var positionIceCreams = function() { var $iceCreamList = $('.ice-cream-card'); var numberOfIceCreams = $iceCreamList.length; $iceCreamList.each(function(i) { var spacingX = -50 + 35 * i; var spacingY = -50 + 5 * i; $(this).css("z-index", numberOfIceCreams - i...
true
b0b70f0bafee481dd25579e4dae8e68cdf948ac3
JavaScript
DonnaAnnIssac/watchNext-js
/server/lib/helper.js
UTF-8
455
2.8125
3
[ "MIT" ]
permissive
const fs = require('fs') const parser = require('./parser') const populate = require('./populater') let next = 0 let filesArr = [] let dataArr = [] const callNext = dataObj => { next++ dataArr.push(dataObj) callParser() } const callParser = () => { if (next < filesArr.length) parser(filesArr[next], callNext) ...
true
8f6773647508a00e077859ca45e030eb789302d7
JavaScript
sheyna/bannedbooks
/js/bannedbooksscript.js
UTF-8
6,412
3.40625
3
[]
no_license
// var counter = 0; // var sorted; var sortingTimer; // BROOK'S SHUFFLE FUNCTION FROM CLASS: // shuffle books: function shuffle(m) { // swap last card with a random card from left var $m, rand = Math.floor(Math.random() * m), $rand; $('li').removeClass('swapping'); $mth = $('.card:eq(' + m + ')') ...
true
afaece4c6dc5152d5e6de3278a81c953c779a522
JavaScript
Al-Galib/Javascript_Chat_app
/index.js
UTF-8
707
2.78125
3
[]
no_license
var express=require('express'); var socket= require('socket.io'); var app = express(); var server =app.listen(4000,function(){ console.log('listening to requists on port 4000'); }); //static files app.use(express.static('public')); //socket setup var io = socket(server); io.on('connection', function...
true
1d25c9e9aa227d1d9d5cc7c02352edec50540b2b
JavaScript
sakshi1999/thecatapi
/thecatapi/js/images.js
UTF-8
1,308
2.671875
3
[]
no_license
//link all pages function vote() { window.location.assign("http://127.0.0.1:5500/html/vote.html"); } function favourtie() { window.location.assign("http://127.0.0.1:5500/html/favourite.html"); } function upload() { window.location.assign("http://127.0.0.1:5500/html/upload.html"); } var listcatdiv = document.get...
true
4c9a8c1b0338ecdf1039dcc93298726afcd22772
JavaScript
dlaststark/machine-learning-projects
/Programming Language Detection/Experiment-2/Dataset/Train/JavaScript/multisplit-1.js
UTF-8
270
2.59375
3
[]
no_license
RegExp.escape = function(text) { return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); } multisplit = function(string, seps) { var sep_regex = RegExp(_.map(seps, function(sep) { return RegExp.escape(sep); }).join('|')); return string.split(sep_regex); }
true
23ad5aa184055d2083a4baa5dd51c1b6fd2f1f4c
JavaScript
jyotibar/plotly_django
/plot.js
UTF-8
1,345
2.96875
3
[]
no_license
TESTER = document.getElementById('tester'); var y_one= [20, 14, 23] var y_two = [12, 18, 29] var trace1 = { x: ['giraffes', 'orangutans', 'monkeys'], y: y_one, name: 'SF Zoo', type: 'bar' }; var trace2 = { x: ['giraffes', 'orangutans', 'monkeys'], y: y_two, name: 'LA Zoo', type: 'bar' }; var data = [t...
true
6848b76cc512626e1507e806d5d2754be030a6b8
JavaScript
colinah/HackerRank
/kangaroo.js
UTF-8
418
3.1875
3
[]
no_license
function kangaroo(x1, v1, x2, v2) { if(v1 === v2 || v2 > v1){ return 'NO' } else { let diff = x2-x1 let velDiff = Math.abs(v2-v1); if(diff % velDiff === 0){ return 'YES' } else { return 'NO' } } } (()=>{ const x1 = 0, v1 =...
true