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
40d720f6c95ec72597babc70baad5c6c43c33954
JavaScript
ahmadz2/express-poc
/app.js
UTF-8
425
2.953125
3
[]
no_license
const express = require('express') const app = express() const port = 3000 app.get('/', (req, res) => res.send('Hello World!')) //Responds with 'Hello World' on homepage //app.METHOD(PATH, HANDLER) //Syntax for routing app.use(express.static('public')) //Serve static files using Public directory - access using ...
true
a7a344887b01071499a88230b90f0c5d4d20d589
JavaScript
joshwcomeau/beatmapper
/src/store/persistence-engine.js
UTF-8
1,429
2.671875
3
[ "MIT" ]
permissive
/** * Store redux state in local-storage, so that the app can be rehydrated * when the page is refreshed. */ import localforage from 'localforage'; import debounce from 'redux-storage-decorator-debounce'; import filter from 'redux-storage-decorator-filter'; const key = process.env.NODE_ENV === 'development' ? 'r...
true
3cd3bbae02c2e9233281c6a96ede5ac40a8e2041
JavaScript
evanco239/Front-End-Dev-Examples
/Javascript ES6/main.js
UTF-8
5,723
4.1875
4
[]
no_license
// puts out the same thing // var a = 'Test 1'; // let b = 'Test 2'; //--------------------------------------------------------- // shows the difference between let and var /* function testVar() { var a = 30; if (true) { var a = 50; console.log(a); } console.log(a); } function testLe...
true
6de7b0713f81b2393d8ebefc2819c7f799af7847
JavaScript
XabierGallardo/ReactJS-Minimalist-Tutorial
/Lesson 8: React Router/React Router practical example/src/Shop.js
UTF-8
854
2.921875
3
[]
no_license
import React, {useState, useEffect} from 'react'; //useState holds the information we're getting from the API //useEffect runs that fetch call when the component mounts import { Link } from 'react-router-dom'; import './App.css'; function Shop() { //to render this, we'll use the useEffect function useEffect(() =>...
true
d23ff418cff54943d63b22477183338ded7a9c6d
JavaScript
hkhansh27/count-down-2021
/js/objectFly/configFly.js
UTF-8
2,804
3
3
[]
no_license
function configFly() { this.objectFly; // Đối tượng <img /> dùng để hiển thị hoa hoặc cánh hoa this.width = 10; // Chiều rộng của <img /> this.height = 10; // Chiều cao của <img /> this.top ; this.left ; this.aTop = Math.ceil(Math.random()*6)/10; // Gia tốc của <img /> theo trục Y this.aLeft...
true
72f6da8c20a414dc3ce0d05ead5d3554822766ff
JavaScript
Dmitriylipgart/SeaBattle
/Sea.js
UTF-8
746
3.0625
3
[]
no_license
/** * Created by МитькаКатька on 21.05.2017. parseGuess = function (guess) { var alphabet = ["A", "B", "C", "D", "E", "F", "G"]; var row = alphabet.indexOf(guess.charAt(0)); var column = guess.charAt(1); if (isNaN(column) || column >= 7 || row < 0 || guess === null || guess.length != 2) { ...
true
579e7268e03d4d8a809c85132434ddc919348c63
JavaScript
abasinkanga/ACresteemer
/greetbot/steemBlockTracker.js
UTF-8
6,669
2.65625
3
[ "MIT" ]
permissive
var steem = require("steem"); var fs = require("fs"); var LAST_PARSED_BLOCK_PATH = "./lastParsedBlock.json"; var lastParsedBlock = JSON.parse(fs.readFileSync(LAST_PARSED_BLOCK_PATH)).number module.exports = { readNewBlocks: readNewBlocks, getRootCommentsBetween:getRootCommentsBetween, findFirstBlockAfte...
true
6a988e4f1331f50a8e781f132b7558ccfdc0582d
JavaScript
zwados/to-do-app
/src/Components/TaskList.js
UTF-8
1,179
2.671875
3
[]
no_license
import React from 'react'; import Task from './Task'; const TaskList = (props) => { const active = props.tasks.filter(task => task.active); const completed = props.tasks.filter(task => !task.active) completed.sort((a, b) => b.finishDate - a.finishDate); active.sort((a, b) => { a = a.text.toLow...
true
4f19921c7e32ab8836556747ce1ce85975fa61d6
JavaScript
yunchuan10/ml_group
/recieve/utils/filter.js
UTF-8
3,954
2.625
3
[]
no_license
import Vue from 'vue'; import store from '@/store' // Vuex // 菜单名称 Vue.filter('title', function (value) { let titleMaps = store.state.mainData.routerTitle; if (titleMaps !== undefined && titleMaps !== null && titleMaps !== '' && titleMaps.length > 0) { let titleMap = JSON.parse(titleMaps); return titleMap[...
true
4609a7156205a7418f3acbca6f25a712911f2cdc
JavaScript
garamau/garamau.github.io
/grilleMobileHex-Plus/grilleM/sketch.js
UTF-8
5,216
2.734375
3
[]
no_license
let cote = 20 let l1, l2 let particules = [] let nbX, nbY, br, s, texte, cb, cbt, s2, texte2 let move = false, canvas let trou = false let img = 200 function preload(){ img = loadImage("RotTache9.png") } function setup() { canvas = createCanvas(800, 800) canvas.mousePressed(click) background(img) angleMode(DEGR...
true
ebda587a1a6a62f1344a10a6f2d87546b3357872
JavaScript
Pawelo98/Navbar-app
/example.js
UTF-8
4,716
3.828125
4
[]
no_license
// returns a random number between selected indexes const getRandomArbitrary = (min, max) => { return Math.random() * (max - min) + min; } // returns a board of sizes between 3 and 50 with values between 1 and 10 // changed values to section from 1 to 10 to make a riddle more reasonable const createBoard = () => {...
true
72c6d40fe68c41be71219a7e1dc66eaf82f31a9c
JavaScript
ashwritescode/Clashcard-Generator
/BasicFlashcard.js
UTF-8
456
3.109375
3
[]
no_license
var inquirer = require("inquirer"); var fs = require("fs"); // constructor function for basicflashcard function BasicCard(question, answer) { this.question = question; this.answer = answer; // creates the printInfo method and applies it to all basicflashcard objects this.printInfo = function () { ...
true
74ed6f7e61a67e67ea2889dc2b44534db76ed9da
JavaScript
jackfranklin/pulldown
/test/helpers.js
UTF-8
1,062
2.53125
3
[]
no_license
var nock = require("nock"); var fs = require("fs"); var assert = require("assert"); var mockAndReturn = function(searchTerm, result) { return nock("http://pulldown-api.herokuapp.com/") .get("/set/" + searchTerm) .reply(200, result); }; var mockCdn = function(url) { return nock("https://cdn...
true
2edfa44441097084496afdfa5251129feae0498f
JavaScript
andrwmorph/matrix-appservice-slack
/lib/BaseSlackHandler.js
UTF-8
5,873
2.640625
3
[ "Apache-2.0" ]
permissive
"use strict"; var rp = require('request-promise'); var Promise = require('bluebird'); var promiseWhile = require("./promiseWhile"); var getSlackFileUrl = require("./substitutions").getSlackFileUrl; /** * @constructor * @param {Main} main the toplevel bridge instance through which to * communicate with matrix. */ ...
true
0f1f2a01179491285017836b5211bede3117f891
JavaScript
dfeshed/nw-ueba-saas
/sa-ui/component-lib/tests/unit/rsa-date-time-input/date-validation-test.js
UTF-8
5,831
2.75
3
[ "MIT" ]
permissive
import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; import { validate } from 'component-lib/components/rsa-date-time-input/util/date-validation'; module('Unit | date-validation', function(hooks) { setupTest(hooks); test('A valid set of date values returns no errors', function(assert) {...
true
c781de9ac07caeef3b666ee3cc5c06c41e7bc144
JavaScript
KaptaanBarbosa/BLOG
/server/validations/profile.js
UTF-8
2,029
2.59375
3
[]
no_license
const Validator = require('validator'); const isEmpty = require('./isempty'); module.exports = function validProfileInput(data) { let errors = {}; data.handle = !isEmpty(data.handle) ? data.handle : ''; data.status = !isEmpty(data.status) ? data.status : ''; data.skills = !isEmpty(data.skills) ? data.skills : ''; ...
true
6422e56571e0424092d57a506a6c23fbdf04d6f9
JavaScript
rachhen/mobile-app-backend-sample
/src/pages/user/list/service.js
UTF-8
4,453
2.609375
3
[]
no_license
/** * @author Rachhen * using this file for communicate with other service for user * like firebase */ import moment from 'moment'; import firebase, { db } from '@/utils/firebase'; import { dateFormat, clean } from '@/utils/localParams'; export async function queryUser(params) { try { const users = []; ...
true
e5e7ccab9d5a23ca6e0999667a376af28aa84d82
JavaScript
Cperez2187/SequelizedBurger
/routes/api-routes.js
UTF-8
1,328
2.796875
3
[]
no_license
// ********************************************************************************* // api-routes.js - this file offers a set of routes for displaying and saving data to the db // ********************************************************************************* // Dependencies // =====================================...
true
aa2fb361db177f50c5b8603e3763180bdc97abfb
JavaScript
BacqEstelle/javascript-exercice-2
/0.exoNext/Event/MOUSE-EVENT/script.js
UTF-8
1,491
3.34375
3
[]
no_license
/* becode/javascript * * * * coded by leny@BeCode * started at 26/10/2018 */ (() => { //Div Une document.getElementsByClassName("hoverMe")[0].onmouseover = function () { document.getElementsByClassName("hoverMe")[0].style.opacity = "0"; } //Div Deux document.getElementsByClassNa...
true
0a0d592b2e01e8decf5bfe1ef67a0cf5d8d953be
JavaScript
afarahmand/commodity-analyzer
/javascripts/chartMain.js
UTF-8
2,088
2.765625
3
[]
no_license
import Chart from 'chart.js'; import { roundToHundreths } from './chartControl'; // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ export const createChartMain = canvas => ( new Chart(canvas, { type: 'line', data: { labels: [], datasets: [] }, options: { elemen...
true
3899f88b461a49cbaad66ab8f001c76b5c39fca5
JavaScript
19Sean96/bamazon-cli-app
/bamazonCustomer.js
UTF-8
9,424
2.96875
3
[ "MIT" ]
permissive
const mysql = require("mysql"); const inquirer = require("inquirer"); const connection = mysql.createConnection({ host: "localhost", // Your port; if not 3306 port: 3306, // Your username user: "root", // Your password password: "root", database: "bamazon" }); let productA...
true
af76a5483529a8328f2d75175bc3940e30b50bfd
JavaScript
liangzi-aha/resource
/vue php react/node0504/4-url.js
UTF-8
974
2.875
3
[]
no_license
/** * Created by lanouhn on 18/8/13. */ var http = require('http'); //引入 url 模块 var url = require("url"); var server = http.createServer(function(req,res){ res.setHeader('content-type','text/html;charset=utf-8'); //使用url模块格式化req.url url.parse:将一个URL字符串转换成对象并返回 /*url.parse(urlStr, [parseQueryString], [...
true
602037d268cdb083cb0a4b50eeb82d43af382bde
JavaScript
JohnDing1995/ShanghaitechReservationSystem
/app/models/users_test.js
UTF-8
710
2.65625
3
[]
no_license
var mongoose = require('mongoose'), User = require('./users'); var connStr = 'mongodb://localhost:27017/reservation'; mongoose.connect(connStr, function(err) { if (err) throw err; console.log('Successfully connected to MongoDB'); }); // create a user a new user var testUser = new User({ username: 'dry...
true
ea6a1e6ed8e34c9998f37c057de55497c51fa6ac
JavaScript
iamricard/babel-plugin-transform-react-createelement-to-jsx
/test/chai-convert-to.js
UTF-8
1,895
2.625
3
[]
no_license
import {transform} from 'babel-core' //function cleanAST(ast) { // Object.keys(ast).forEach((key) => { // if (key === 'start' || key === 'end' || key === 'loc' || key === 'range') { // delete ast[key] // } else if (ast[key]) { // if (typeof ast[key] === 'object') { // cleanAST(ast[key]) // } // } // }) // ...
true
38daf57c34ca273dfafc3cc1ad533c8a74aa6007
JavaScript
nickcosmo/react-practice
/state-clicker/src/Clicker.js
UTF-8
795
3.0625
3
[]
no_license
import React, { Component } from 'react'; class Clicker extends Component { constructor(props) { super(props); this.state = { number: 0, winner: false, }; this.IncreaseNum = this.IncreaseNum.bind(this); } IncreaseNum() { this.setState((state, ...
true
4aec075f7c184b85dd14d1fa9dfcdbe194c05078
JavaScript
thinkerous/component-jade2
/index.js
UTF-8
2,420
2.75
3
[ "MIT" ]
permissive
var debug = require('debug')('component-jade2'); var jade = require('jade'); var urlRewriter = require('component-builder').plugins.urlRewriter; module.exports = function (options) { options = options || {}; return function(file, done) { if (file.extension !== 'jade') return done(); debug('compiling jade...
true
16c4e58cffab374efb0d83c08276a6309985af14
JavaScript
shaojunyang/app_down_fore
/src/utils/request.js
UTF-8
6,531
2.578125
3
[]
no_license
import axios from 'axios' import {Message} from 'element-ui' import store from '@/store' import {getToken} from '@/utils/auth' import {getTokenKey} from "./auth"; import {decrypt, Decrypt, Encrypt} from "./AESUtils"; // create an axios instance const service = axios.create({ baseURL: process.env.BASE_API, // api 的...
true
b220f1a8fcbd99448543cc2880b8da5c550b1275
JavaScript
creatorChou/leetcodeAns
/page19/908smallestRangeI.js
UTF-8
857
3.84375
4
[]
no_license
/** * 908. Smallest Range I * https://leetcode.com/problems/smallest-range-i/ */ // Given an array A of integers, for each integer A[i] we may choose any x with -K <= x <= K, and add x to A[i]. // After this process, we have some array B. // Return the smallest possible difference between the maximum value of B...
true
d084d85643fe1608c85d5d65a421146429bc3a41
JavaScript
Bilderbastler/Dynamic-Bar-Graphs
/test/jasmine/spec/examples/_model.spec.js
UTF-8
668
2.6875
3
[]
no_license
define([ 'models/message' ], function(Message){ "use strict"; describe('a model', function() { describe('when instantiated', function() { it('should exhibit attributes', function() { var message = new Message({ text: 'Rake leaves' }); expect(message.get('text')) ...
true
3131e4e28d0bcfadacc3f93bf8d771e57d995916
JavaScript
JohnHe2015/DataStructure
/stack_queue/queue.js
UTF-8
6,665
3.765625
4
[ "MIT" ]
permissive
//define class Queue function Queue(){ var queueArr = []; this.enqueue = function(item){ queueArr.push(item); }; this.dequeue = function() { return queueArr.shift(); }; this.clear = function(){ queueArr = []; }; this.isEmpty = function(){ return queueArr.length == 0; }; this.head = function(){ ...
true
db333924540492415b7ee05bf4ee91e245d77bc9
JavaScript
thdtjsdn/TtwPlatform-00000--JS
/WebPage/root/js/apis/obj/window.apis.obj.copyStructure.js
UTF-8
1,367
2.890625
3
[]
no_license
//----------------------------------------------------------------------------------------------------; //var fileNm = "js/apis/obj/window.apis.obj.copyStructure.js"; //if( console ) console.log( "[ S ] - " + fileNm + "----------" ); //------------------------------------------------------------------------------------...
true
1ea8e03427aee9872adf24edf12c1a5875e56ecd
JavaScript
FaisalAl-Tameemi/zensurance-harverster
/util/sass.js
UTF-8
718
2.546875
3
[ "MIT" ]
permissive
'use strict'; const fs = require('fs'); const sass = require('node-sass'); /** description: a function to convert a SASS file into a CSS file in the `public/stylesheets` directory params: `source` : STRING - source file name `destination`: STRING - destination file name `_done` : FUNCTION - call...
true
561c5f1363aa15ffacf3b9508610b84203da9563
JavaScript
liuyuying123/qianduan_design
/javascript-30/自定义相册/change_by_your_self.js
UTF-8
748
2.84375
3
[]
no_license
(function(){ // 首先找到所有的input标签 // 三个input在触发input事件的时候要改变CSS全域变量的值 const elements=document.querySelectorAll('input'); // 添加监听事件 elements.forEach(input => { // alert(1); input.addEventListener('input',handles); }); // 事件处理函数,首先得到当前input标签当中Value的单位(自定义),然后改变全局CSS变量的值 fun...
true
cd502fcda0f433dbf035dd4eb968bd1869cf028a
JavaScript
bsudhakarreddy118/03_javascript
/05_builtinObjects.js
UTF-8
542
3.6875
4
[]
no_license
let sentence = 'hello1world2new,test'; let words = sentence.split(/[0-9,]/); console.log(words); let strNum = '101'; let strNum2 = '100.25'; console.log('Is it a number',Number.isNaN(strNum)); // ---------------------------------- let num1 = Number.parseInt(strNum); let num2 = Number.parseFloat(strNum2); console....
true
12436dcfddce351485af352c01230f7d5f97ebe4
JavaScript
BrunoSS8/repeating-cli
/cli.js
UTF-8
447
3.453125
3
[ "MIT" ]
permissive
#!/usr/bin/env node import meow from 'meow'; const cli = meow(` Usage $ repeating <count> [string] Examples $ echo "foo$(repeating 10)bar" foo bar $ repeating 3 'unicorn ' unicorn unicorn unicorn `); if (cli.input.length === 0) { console.error('Specify how many times to repeat the string')...
true
9e21746c50079f703775a626ea6e61c2dce055b9
JavaScript
xXxMy-GitHub-UsernamexXx/pset-3
/src/temperature.js
UTF-8
2,023
3.140625
3
[]
no_license
const readlineSync = require("readline-sync"); const MIN = Number.MIN_SAFE_INTEGER; const MAX = Number.MAX_SAFE_INTEGER; const FAHRENHEIT_MELTING_POINT = 32; const FAHRENHEIT_BOILING_POINT = 212; const CELSIUS_MELTING_POINT = 0; const CELSIUS_BOILING_POINT = 100; const KELVIN_MELTING_POINT = 273.2; const KELVIN_BOILIN...
true
6c03ba7f94a51f82ca7104183cd210fd8721da38
JavaScript
donfanning/pushy-chrome-extension
/app/scripts/backup/zip.js
UTF-8
1,506
2.875
3
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
/* * Copyright (c) 2016-2017, Michael A. Updike All rights reserved. * Licensed under Apache 2.0 * https://opensource.org/licenses/Apache-2.0 * https://goo.gl/wFvBM1 */ window.app = window.app || {}; /** * Zip utilities * @namespace */ app.Zip = (function() { 'use strict'; new ExceptionHandler(); /** ...
true
2e051e5ad461b91f960560366ca78be443b24b21
JavaScript
hacm2016/hackaton-sem01
/semana_01/circle/index.js
UTF-8
364
2.96875
3
[]
no_license
let canvas=document.getElementById('mycanvas'); let context=canvas.getContext("2d"); let centerX=canvas.width / 2; let centerY=canvas.height / 2; let radius=70; context.beginPath(); context.arc(centerX,centerY,radius,0,2*Math.PI,false); context.fillStyle='green'; context.fill(); context.lineWidth=5; context...
true
20ea7ca57eab4663f5bbbfc6c1ad82c38fac4a51
JavaScript
Yurii-Melnyk93/Yurii-Melnyk93.github.io
/Project303/js/main.js
UTF-8
2,549
2.515625
3
[]
no_license
$(function() { ////////////////// $("#headForm").submit(function (e) { // Устанавливаем событие отправки для формы с id=form e.preventDefault(); var formData = $(this).serialize(); // Собираем все данные из формы $.ajax({ type: "POST", // Метод отправк...
true
af3c0281fbeca497f6a65ea0960383805c003ce8
JavaScript
yuan00611/Data-Structure-and-Algorithm-Practice
/LeetCode/Array/0922Sort_Array_By_ParityII.js
UTF-8
745
4.40625
4
[]
no_license
// Given an array A of non-negative integers, half of the integers in A are odd, // and half of the integers are even. // Sort the array so that whenever A[i] is odd, i is odd; // and whenever A[i] is even, i is even. // You may return any answer array that satisfies this condition. // Input: [4,2,5,7] // Output: ...
true
60c53285c098aa526bf7258ab8ab72fe086afd2d
JavaScript
MalihaKabir/WebDevelopment-Andrei--exerciseFilesWithSolutions
/Js excercise/Section - 13/AdvancedObjects(142)/script.js
UTF-8
819
4.3125
4
[]
no_license
// Reference Type // Context vs Scope // Instantiation: // Instantiation is when you make a copy of an object and reuse the code. class Player { constructor(name, type) { console.log('player', this); this.name = name; this.type = type; } introduce() { console.log(`Hi I am ${this.name} and...
true
8a87bfb6bd07e479a6dd454cfe28d8a8d272f5fc
JavaScript
albert-gonzalez/js-this-prototype-examples
/examples/prototype/exercises/prototype.class.exercise.spec.js
UTF-8
8,830
3.203125
3
[]
no_license
import { Polygon, Square, Triangle } from './prototype.class.exercise'; import each from 'jest-each'; const SOME_LABEL = 'some label'; const SOME_SIDE_LENGTH = 5; const SOME_BASE_LENGTH = 10; const SOME_HEIGHT_LENGTH = 4; describe('polygon', () => { let polygon; beforeEach(() => { polygon = new Polyg...
true
6f10bb185980a3311272697ae452f9553293abf8
JavaScript
jakecarpenter/capture-m
/js/capture.js
UTF-8
9,327
2.625
3
[]
no_license
//capture web var capture = (function(){ //what are we looking at? var activeEvent; //the events var events = []; //the cards var cards = {}; //the users for this event var authors = {}; //parse app key var parseAppId = 'JfuHc...
true
c7f96c7bb7c10875d3ffcae7a3f0bfc0f20f0588
JavaScript
vitalis-wiens/GizMOGraphJs
/GizMOGraphJS/Tools/UserInteractions/SVG/SVGDragInteraction.js
UTF-8
1,897
2.90625
3
[]
no_license
// this should be a singleton //@flow import expose from "../../../Utils/ClassFunctionBinder"; import * as d3 from 'd3'; let dragInstance = null; /** * @return {null} */ let SVGDragInteraction = function (){ if ( dragInstance === null ) { dragInstance = new DragInteraction(); } return dragInstance; }; e...
true
53fb36701417f697b7546ff724f104285cbf9bd2
JavaScript
LuisDavidEcheverria/MA
/public/js/validacion.js
UTF-8
3,048
2.625
3
[]
no_license
function validaringreso(cont){ var obtemail= cont.email.value; var obtpass = cont.password.value; if(obtemail==""){ alert("Campo Email Vacio"); cont.email.focus(); return false; }else if(obtpass==""){ alert("Campo Password Vacio"); cont.password.focus(); ...
true
c1e5fc8c560aafcfc517ffa7a39526052e231d9f
JavaScript
Tarun3165/mini-project
/clock/clock.js
UTF-8
655
3.375
3
[]
no_license
setInterval(() => { var hourHand = document.getElementById("hourHand"); var minhand = document.getElementById("minhand"); var secHand = document.getElementById("secHand"); var date = new Date(); var htime = date.getHours(); var mtime = date.getMinutes(); var stime = date.getSeconds(); ...
true
2ef25806e930ff7c8d4530828b3b702611e09125
JavaScript
baolongge/screen
/src/util/eventEmitter.js
UTF-8
1,917
2.8125
3
[]
no_license
const listeners = function(cb) { setTimeout(() => { window.addEventListener("storage", cb) }, 0) } const local = window.localStorage const EMITTER_KEY = "_emitter" const record = {} export default class EventEmitter { handleEvent = {} constructor(event = "_events") { this.event = event } on(type, handler) { ...
true
98c5ad701fda3877b40f4e5f0adf9903a436c822
JavaScript
balasan/mickalene-thomas
/common/custom/animation.js
UTF-8
1,568
2.90625
3
[]
no_license
function Animation(params){ this.inContainer = params.newContainer; this.outContainer = params.oldContainer; this.delay = params.delay; this.dispatch = params.dispatch; this.renderFunction = params.renderFunction; this.class = params.class; } Animation.prototype.animateIn = function( items){ var self = ...
true
804ce6bdd911e5b60a674b45c42f2dd649b42827
JavaScript
paramesh486/Last-Game
/sketch.js
UTF-8
3,193
2.65625
3
[]
no_license
var bulletG, jetG, heliG, jetG2; var gameState = "play"; var score=0 function preload() { backgroundI = loadImage("backgorund.jpg"); heliI = loadImage("Helicopter.gif"); jetI = loadImage("Jetimage.png"); jet2I = loadImage("jet2.png"); restarti = loadImage("restarticon.jpg"); GameOver = loadImage("GameOver.p...
true
db7679fc8cb2e86fd34900f7dedb1d45d46ba471
JavaScript
wyqx696/bookkeeping
/js/showpercent.js
UTF-8
264
2.8125
3
[]
no_license
function showpercent(money){ var value,text; var html=""; for(var i=0.01;i<1.01;){ value=money*i; text=Math.floor(value*100)/100; html+="<option value='"+text+"'>"+parseInt(i*100)+"%(¥"+text+")</option>"; i=i+0.01 } $("#percent").append(html); }
true
33726416de7c3599e83a07673df5c9513bc91cac
JavaScript
rukundoeric/mangrove-cli
/src/mangrove/events.js
UTF-8
460
2.703125
3
[ "MIT" ]
permissive
/* eslint-disable require-jsdoc */ /* eslint-disable import/prefer-default-export */ import { EventEmitter } from 'events' import inquirer from 'inquirer' const event = new EventEmitter() export default class Event { async define() { this.event = event return this } async prompt(name, body) { let object = {...
true
4d9d3d131ca9b84a5f7ba55cf1bdd4542a9f0b55
JavaScript
olegpisklov/leetcode
/leetcode/medium/Sequence Reconstruction/index.js
UTF-8
1,891
3.109375
3
[]
no_license
const main = (original, sequances) => { const graph = {}; const indegreesCount = {}; for (let i = 0; i < sequances.length; ++i) { const sequance = sequances[i]; for (let j = 0; j < sequance.length - 1; ++j) { if (graph[sequance[j]] === undefined) { graph[sequanc...
true
ca2736e0acb871ccff8d6457af5d9b383635f756
JavaScript
joaoneto/slate-irc-parser
/index.js
UTF-8
2,320
2.734375
3
[ "MIT" ]
permissive
/** * Module dependencies. */ var util = require('util'); var debug = require('debug')('slate-irc-parser'); var Stream = require('stream'); /** * Expose `Parser`. */ module.exports = Parser; /** * Initialize IRC parser. * * @param {Object} options * @return {Type} * @api public */ function Parser(option...
true
b9f3f7ea192a3cda5c564262607010fa3c2660b0
JavaScript
PatrickLef/hamsterpaj4
/packages/comment/js/comment.js
UTF-8
2,537
2.65625
3
[]
no_license
$(document).ready(function(){ // Document is loaded, allow some return false javascripts $('.comment_form .submit').removeAttr('disabled', 'disabled'); $('.comment_list .remove').css('display', 'inline'); // Empty input field $('.comment_form .text').click(function() { var pointer = $(this).parent()....
true
71f47eee1e796b6dfff86eec268ada9b347b362e
JavaScript
vishal4victory/SYSTAC
/e2e/config/JavaScript/AgentMetaData.js
UTF-8
2,663
2.5625
3
[]
no_license
const BaseMetaData = require('./BaseMetaData'); const process = require('process'); /** * A class to gather metadata about the agent the tests are run against. * Agent meaning the browser the application under test is rendered on * plus the operating system used to host the browser. */ class AgentMetaData extends ...
true
e579fc104fa91b9d414e79db26a56f2b203d8376
JavaScript
cathlevettgraphics/hows-your-day-looking
/js/weatherApp.js
UTF-8
2,668
3.703125
4
[]
no_license
/******************** * * FETCH DATA * ********************/ // Init weather export let weather; export function fetchWeather(dataRequest) { fetch(dataRequest) .then((response) => { if (!response.ok) { throw response; } // Parse the response return response.json(); }) ...
true
c476b6b0255b8babe1775bfdde1685f63fbb381b
JavaScript
ironhack-remote/w1d4
/advanced-functional-thinking/script.js
UTF-8
5,241
4.15625
4
[]
no_license
// setTimeout(function () { // console.log("WHERE IS THE LOVE"); // }, 1); console.log("Hello"); function name(arrayOfNamex) { console.log(arrayOfNamex); } const oneTwoThree = 123; name(oneTwoThree); [1, 2, 3].forEach(function (element) { console.log(element); }); function welcomeMessage(name) { return `We...
true
442857777c4d14ff48338bba45ede3f2ddf975a6
JavaScript
JesusReyes01/shelfie_part3
/server/controller.js
UTF-8
2,021
2.671875
3
[]
no_license
module.exports = { getInventory: (req, res) => { const db = req.app.get('db') db .getInventory() .then(product => res.status(200).send(product)) .catch(err => res.status(500).send(err)) }, addProduct: (req, res) => { const db = req.app.get('db') ...
true
d0a3d5f7894e4274065c10834774b93d77a07ef9
JavaScript
ksunilssah/server-side-react-redux
/server/src/client/pages/UserListPage.js
UTF-8
1,017
2.53125
3
[ "MIT" ]
permissive
import React, { Component } from 'react'; import { connect } from 'react-redux'; import { Helmet } from 'react-helmet'; import { fetchUser } from '../actions'; class UserList extends Component { componentDidMount() { this.props.fetchUser(); } renderUsers() { if (!this.props.users.length) return false; ...
true
f83f0351d6bd970fa5bf11d4582ca941f6c7b058
JavaScript
g-chance/web_fun
/week1/primeNumbers/primeNumbers.js
UTF-8
390
3.984375
4
[]
no_license
// My first program! function primeNumbers(x) { var arr = []; for(var i = 2;i<=x;i++) { var sum = 0; for(var j = 1; j<=i; j++) { if(i%j === 0) { sum += 1; } } if(sum <= 2) { // console.log(i); arr.push(i); } ...
true
0226d9d2e4fd54465476ffad1ec4230283603aef
JavaScript
joedwagner/neighborhood-map
/js/main.js
UTF-8
6,288
2.671875
3
[]
no_license
function init(error) { var map = null; if (!error) { // Create the map map = initMap(); } else { console.log($); alert('Error loading Google Map. Please reload the page and try again.'); } // Create the ViewModel var vM = new ViewModel(placeList, m...
true
04f7be8b53d253e75bb8649c2e81c72ca85e2e4c
JavaScript
HannahVaschel/assignments
/exercises/nameentry/src/App.js
UTF-8
1,140
3.03125
3
[]
no_license
import React, { Component } from 'react' class App extends Component { constructor(){ super() this.state = { name: "", array: [], } } handleChange = (e) => { this.setState ({ [e.target.name]: e.target.value, }) } handleSu...
true
3cf314aee669eaad87c04ae14b65c23c81f19357
JavaScript
aninditaaghosh/anindita_ghosh
/javascript/fibonacci.js
UTF-8
224
3.5625
4
[]
no_license
function fibonacci(len) { var num1=0; var num2=1; console.log(num1); console.log(num2); var fibo=0; while (len>2) { fibo=num1+num2; console.log(fibo); num1=num2; num2=fibo; len=len-1; } } fibonacci(7)
true
83b5f1528ac651392b72c2184a8ebc427ba79e45
JavaScript
EMaude/ElephantBot
/index.js
UTF-8
1,921
2.78125
3
[ "MIT" ]
permissive
//Elliot Maude //Discord Bot //Created: September 2017 // // //Last Updated: 8th August 2018 - move to postgres //------------// //NPM Requires const discord = require('discord.js'); const express = require('express'); //Custom Requires const config = require('./configs/config.json'); const searcher = require('./imag...
true
61591f950c22aff5dd082dca36a3f50a16b6576c
JavaScript
balenaultra/solicitacoes-api
/src/controllers/request_type.js
UTF-8
1,075
2.546875
3
[]
no_license
'use strict'; const repository = require('../repositories/request_type'); exports.get = async(req, res, next) => { try { var data = await repository.get(); res.status(200).send(data); } catch (e) { res.status(500).send({ message: 'Falha ao processar sua requisição' ...
true
bf62de4c521eca69f683638ef93e0cccffbb7e69
JavaScript
averywlittle/fullstackopen
/part2/countries/src/components/Matches.js
UTF-8
923
2.578125
3
[]
no_license
import React from 'react' import CountryView from './CountryView' const Matches = (props) => { if (props.query === '') { return ( <div>Type something above to search for a European country by name</div> ) } if (props.selectedCountry.length !== 0) { return ( <CountryV...
true
db941505ba8d7eb6f7f787d5e55f8f76c9d159af
JavaScript
frasnym/Crawl-Job-Vacancy-at-Cermati-Karir
/index.js
UTF-8
1,881
2.703125
3
[]
no_license
console.time("crawl"); const puppeteer = require("puppeteer"); const fs = require("fs"); const { getDetail } = require("./detail"); const url = "https://www.cermati.com/karir"; (async () => { const browser = await puppeteer.launch({ // headless: false, }); const page = await browser.newPage(); await page.goto(...
true
f2cd3721c66ab90f1667d92f7b54ea596b2989a2
JavaScript
Wn-1231/my-snippet
/防抖debounce.js
UTF-8
796
3.1875
3
[]
no_license
// js 实现防抖函数 function debounce (fn, wait) { let timeoutID = null return function (...args) { const context = this if (timeoutID) { clearTimeout(timeoutID) } timeoutID = setTimeout(() => { timeoutID = null fn.call(context, ...args) }, wait) } } functi...
true
72254f630db5c254cdd14d9e950413c7314a8e71
JavaScript
RUGSoftEng/Team-5
/app/user.js
UTF-8
1,537
2.703125
3
[ "LicenseRef-scancode-unknown-license-reference", "CC0-1.0" ]
permissive
/* file: cookie.js * authors: H. Bouakaz, S. de Vliet, S. de Jong & E. Werkema * date: 22/4/2016 * version 1.0 * * Description: Module for using Cookies */ require('electron-cookies'); define(['app/database'], function (db) { var user = { setCookie: function(result){ document.cookie = 'user_name='+result[...
true
dfc8299c24415c44b106612f24f370c5710f7b14
JavaScript
shinnn/is-file-utf8
/index.js
UTF-8
804
2.65625
3
[ "ISC" ]
permissive
'use strict'; const {promisify} = require('util'); const {open, read} = require('fs'); const isUtf8 = require('is-utf8'); const ARG_SPEC = 'Expected 1 argument (path: <string|Buffer|URL>)'; const promisifiedOpen = promisify(open); const promisifiedRead = promisify(read); module.exports = async function isFileUtf8(....
true
c2c42fc102bd3e39d2e990f9b3b0626a2c485a56
JavaScript
po-trottier/concordia-instaclone
/scripts/encryption.js
UTF-8
2,608
2.859375
3
[]
no_license
/* eslint-disable import/no-extraneous-dependencies */ const fs = require('fs'); const crypto = require('crypto'); const path = require('path'); // file names const encFile = './.env.enc'; const decFile = './.env'; // algorithm constants const hashAlgorithm = 'sha256'; const cipherAlgorithm = 'aes256'; function encr...
true
33342cc60db8d192b911e8d9afb9bc1d0fe7a57a
JavaScript
bnz-digital/fp
/src/runkits/deductive/ramda-map.js
UTF-8
555
3.3125
3
[ "MIT" ]
permissive
const code = `import { map } from 'ramda' const squares = [1, 4, 9, 16, 25] // Vanilla JS with the Array.map method console.log('Array.map', squares.map(Math.sqrt)) // The Ramda map equivalent console.log('Ramda map', map(Math.sqrt, squares)) // But the Ramda map is curried! const mapSquareRoots = map(Math.sqrt) c...
true
5264aafcba728e8318118db354158d1d36fb55b4
JavaScript
AdityaMullick/Tutorial
/dist/src/main/js/api/path/TupleStar.js
UTF-8
1,061
2.78125
3
[]
no_license
define( /* Class name */ 'main/api/path/TupleStar', /* Class dependencies */ ['main/api/path/PathStep', 'main/util/assert', 'main/api/path/TupleNav'], /* Class symbols */ function (PathStep, assert, TupleNav) { 'use strict'; /** * @class The tuple star step. ...
true
df199bf982020611eb024f06c0ecdf30cd9d32d1
JavaScript
AhmedBenZid/Dom
/Shopping Cart/Res/script.js
UTF-8
1,540
3.34375
3
[]
no_license
let buttonplus = document.getElementsByClassName("plus"); for (let plus of buttonplus) { plus.addEventListener("click", function () { plus.previousElementSibling.value++; shoppingTotal(); }); } let buttonminus = document.getElementsByClassName("minus"); for (let minus of buttonminu...
true
c0a59c1dfb042945db2230b83291018c9b3bfb69
JavaScript
justinjungkorea/knowledgepoint_webrtc
/public/js/signup.js
UTF-8
1,188
2.65625
3
[]
no_license
document.addEventListener('DOMContentLoaded', function () { let inputId = document.getElementById('InputId') let inputPw = document.getElementById('InputPw') let inputName = document.getElementById('InputName') let sigupBtn = document.getElementById('SigupBtn') let reqNo = 1 signalSocketIo.on(...
true
a0673ee19c3d452e6b6176e00318639e97491bf8
JavaScript
san994/pro-34
/Monster.js
UTF-8
586
2.6875
3
[]
no_license
class Monster{ constructor(x,y){ var options = { density : 0.04, friction : 1, isStatic : false, restitution : 0.5 } this.radius = 10; this.body = Bodies.circle(x,y,100,options); this.image = loadImage("Monster-01.png"); /...
true
4d80e310b063bd27f2afaaf1a0f591548c14fc3c
JavaScript
WildCodeSchool/paris-0218-loop-4
/client/js/profil.js
UTF-8
401
2.71875
3
[ "MIT" ]
permissive
/* global fetch, URLSearchParams */ import { createUserDetailElement } from './component/user.js' const userElement = document.getElementById('user') const params = new URLSearchParams(window.location.search) const id = params.get('id') fetch(`http://localhost:8080/users/${id}`) .then(response => response.json()) ...
true
6ad597c5e82e8c3ac9b2c42ee079fd4c8c22c0d9
JavaScript
SharmitaC/Fundamental-basic-5.
/app.js
UTF-8
2,178
4.15625
4
[]
no_license
// JavaScript Document myArray = ["variable.name", "variable.age", "variable.genre"]; variable.name = "Mike"; console.log(treat_it_as_variable_name(myArray[0])); var person = {name:"Tahir Akhtar", occupation: "Software Development" }; var p1="name"; var p2="occupation"; console.log(person[p1]); //will print Ta...
true
12aca234b187b4939e5a60725650b63eb986be4f
JavaScript
ANRecalde/CursoIngresoJS
/1-EntradaSalida/jsEntradaSalida-06.js
UTF-8
333
3.421875
3
[]
no_license
/* Debemos lograr tomar Los numeros por ID , transformarlos a enteros (parseInt) y Sumarlos. mostrar el resulto por medio de "ALERT"*/ function sumar () { var suma; var numero1=txtIdNumeroUno.value; var numero2=txtIdNumeroDos.value; suma = parseInt (numero1)+parseInt (numero2); alert("El resultado de su suma es "...
true
713438bd9950d023ab1d56837f27c2a0ecdebac4
JavaScript
xururuca82/modern-javascript
/08 함수/function-argument.js
UTF-8
321
3.71875
4
[]
no_license
// function f(x,y) { // console.log("x = "+x+", y = "+ y); // } // f(2) function multiply(a, b) { b = b || 1; // b의 초깃값을 1로 설정 return a*b; } console.log(multiply(2,3)); console.log(multiply(2)); function f(x,y) { arguments[1] = 3; console.log("x = "+x+", y = "+ y); } f(1, 2)
true
ab02d5b93cad5f6e8b26679a4dae99cd2f792cde
JavaScript
ronaldo-aquino/react-fundamentos
/src/components/basicos/Aleatorio.js
UTF-8
446
3.078125
3
[]
no_license
const Aleatorio = ({ min, max }) => { const valorEscolhido = parseInt(Math.random() * (max - min + 1) + min); return ( <> <h2>Valor Aleatório</h2> <p> <strong>Valor Mínimo: </strong> {min} </p> <p> <strong>Valor Máximo: </strong> {max} </p> <p>...
true
a11b616cc0e3b1d03f051683ee87cdd2a29e8346
JavaScript
senyaak/project_days_messanger
/src/server/user.js
UTF-8
4,890
2.625
3
[]
no_license
var mongoose = require('mongoose'); var crypto = require('crypto'); var Schema = mongoose.Schema; // create a user schema var userSchema = new Schema({ username: { type: String, required: true, unique: true }, authtoken: String, socket: String, contactList: [String], }); var User = mongoose.model('User', use...
true
519e159432990334c796f582eee8a68db5db2eb2
JavaScript
LukeGeneva/weather-cli
/weather.js
UTF-8
649
2.84375
3
[]
no_license
const fetch = require("node-fetch"); const { asyncPipe } = require("./util"); const fetchCurrentWeather = (apiKey) => (zip) => asyncPipe(buildURL(apiKey), fetch, json)(zip); const buildURL = (apiKey) => (zip) => `http://api.openweathermap.org/data/2.5/weather?zip=${zip}&appid=${apiKey}&units=imperial`; const jso...
true
05c74b801523ca3ec1978ec81d93dd7aa5335606
JavaScript
Miyaaaa/FElearn
/BaiduIFE/task16/js/task.js
UTF-8
2,735
3.359375
3
[]
no_license
/** * Created by admin on 2016/8/8. */ /** * aqiData,存储用户输入的空气指数数据 * 示例格式: * aqiData = { * "北京": 90, * "上海": 40 * }; */ var aqiData = {}, addBtn = document.getElementById("add-btn"), cityInput = document.getElementById("aqi-city-input"), valueInput = document.getElementById("aqi-value-input")...
true
0777b33aa3c2adabd990de540c5ffafbfa652f08
JavaScript
breachofmind/packship-acc
/resources/jsx/BoxTab.jsx
UTF-8
4,197
2.640625
3
[]
no_license
import React from 'react' import classnames from 'classnames' import BoxTable from './BoxTable.jsx' import utils from '../js/utils' /** * This component consists of the Box tab and controls its visibility. * Inside the box tab are the Box Table components. * @constructor */ class BoxTab extends React.Component { ...
true
1a4c64e869c7f930173b7d0e0f9443573cfaddb7
JavaScript
jpmacveigh/WCS-MF
/callback.js
UTF-8
509
4.125
4
[]
no_license
/* Une fonction de retour (callback) est une fonction comme les autres. Sa particularité est qu'elle est appelée par une autre qui l'a reçu en tant que paramètre. */ function test(fct_retour) { fct_retour(); // appel de la fonction } function retour1() { console.log('Retour 1'); } function retour2() { console.log...
true
be5ea6927ec74113756eded092ef3247352d53d4
JavaScript
kladya/calculator
/js/main.js
UTF-8
1,690
3.3125
3
[]
no_license
'use strict'; const input = document.querySelector('input'); const number = document.querySelectorAll('[data-number]'); const operator = document.querySelectorAll('[data-operator]'); const equals = document.querySelector('[data-action="calculate"]'); const clear = document.querySelector('[data-action="clear"]'); let i...
true
0cae629417bd524a4eff41e116ac54261aaa29a8
JavaScript
wendy-poppy/jingyingba
/js/header.js
UTF-8
771
2.703125
3
[]
no_license
//city var city = document.querySelector(".city"); var city_list = document.querySelector(".city_list"); var jiantou = document.querySelectorAll(".city span")[1]; var underline = document.querySelector(".underline"); var flag; city.onclick = function(){ if(!flag){ city_list.style.display = "block"; ...
true
42fb45672ec7b581d493e0c7b3b7c1201baf0afd
JavaScript
duthanhduoc/Javascript-K1
/5. Xu ly loi va Regex/6. Regex Shorthand character classes/app.js
UTF-8
72
2.59375
3
[]
no_license
const regex = /[^HG]ay/i let a = regex.test('ay') // true console.log(a)
true
3cecf93a1cb78f2677999067bedf85d2a580b45b
JavaScript
delayd0/deferredflow
/test/main.js
UTF-8
928
2.96875
3
[ "MIT" ]
permissive
'use strict'; // Load dependencies const TestCase = require('ava'); const DeferredFlow = require('..'); TestCase('stops when default calls count is met', async (t) => { const dflow = new DeferredFlow(); setTimeout(() => dflow.next(true), 100); const flowResult = await dflow.dispense(); t.true(flowRe...
true
815cdefc745c5a9608c882567bebaa505983d456
JavaScript
nikolayneykov/TelerikAcademyAlphaJavaScript
/Preparation/Workshop1BasicProgramming/04.BottleDeposit.js
UTF-8
411
3.296875
3
[ "MIT" ]
permissive
const getGets = arr => { let index = 0 return () => { const toReturn = arr[index] index += 1 return toReturn } } // this is the test const test = ['10', '10'] const gets = this.gets || getGets(test) const print = this.print || console.log let halfLiterBottles = +gets() let oneLiterBottles = +gets()...
true
5e277e77ec4e7104d7d82dc03beda6984d8df888
JavaScript
Packapeer/self-tech-master-new
/success/js/alert/dist/js/simpleToast.js
UTF-8
3,815
2.546875
3
[ "MIT" ]
permissive
'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.definePrope...
true
57b4783d10709b81481cfa5d438477b369f70b41
JavaScript
yl-br/to-do-list
/server.js
UTF-8
1,361
2.5625
3
[]
no_license
const express = require('express') const app = express() const port = 3000 app.use(express.static(__dirname + '/public')); app.use(express.urlencoded( {extended: true} )); app.use(express.json()); /* const cors = require('cors'); app.use(cors()); app.options('*', cors()); */ const DbAdapter = require('./...
true
793e5ebf89403cad2d59f2a72c24487278776ed0
JavaScript
prgbono/KC_p5_FrontJS
/js/controllers/ErrorController.js
UTF-8
675
2.703125
3
[]
no_license
import BaseController from './BaseController.js'; import { errorView } from './../views/errorView.js' export default class ErrorController extends BaseController { constructor (element){ super(element); this.subscribe(this.events.ERROR, (err) => { this.showError(err); }); } showError(error...
true
579344f946c3eb529d0ba6a38bfb3a0090e2aad2
JavaScript
su-u/Class
/code/JavaScript/ICS/ICS.js
UTF-8
2,940
3.078125
3
[]
no_license
const Enumerable = require("linq"); const Student = require("./Student"); const Laboratory = require("./Laboratory"); class Assignmment { constructor() { const LaboCount = 10 this.CanAssignLaboCount = LaboCount; this.students = []; this.laboratories = []; for (let index = 0...
true
f4376219db1a0a9d4272b70a5622b7de3aff65fa
JavaScript
tgvashworth/sonic
/src/sonic.js
UTF-8
8,757
2.671875
3
[]
no_license
/* * Sonic 0.3 * -- * https://github.com/phuu/sonic * -- * Originally by James Padolsey: https://github.com/padolsey/Sonic * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The...
true
098731982bb66a3a859665757f6525a8d1c08b6c
JavaScript
fancyghost-ys/onlineLouvre
/client/src/store/reducers/art.js
UTF-8
1,209
2.53125
3
[]
no_license
import { FETCH_ART_PIECES, FETCH_NEW_ART, EDIT_ART, DELETE_ART, GET_ALL_USERS, GET_PIECE_BY_ID } from '../types/types' const initialState = { artPieces: [], artPiece: {}, newPiece: '', editStatus: false, deleteStatus: false, users: [] } const artReducer = (state = initialState, action...
true
3e63122ad11f23438f92928cc0742f695872fc10
JavaScript
denzelb5/doggie-day-care
/src/helpers/data/doggieData.js
UTF-8
526
2.59375
3
[]
no_license
import axios from 'axios'; import apiKeys from '../apiKeys.json'; const baseUrl = apiKeys.firebaseKeys.databaseURL; const getAllDogs = () => new Promise((resolve, reject) => { axios.get(`${baseUrl}/dogs.json`) .then((response) => { const theDogs = response.data; const dogs = []; Object.keys(th...
true
7a519caf08a55708955cc7304884e24be58c2ead
JavaScript
wijohnst/data_puller
/datapuller.js
UTF-8
4,383
3.5
4
[]
no_license
/* onLoad() -> // One of App Scripts default triggers. A function (in this case, populateSheets()) is called whenever the spreadsheet is opened populateSheets() -> getReports() // returns an array of File Objects (custom type) interface FileObj = { ...
true
8ae4ae87ee5594161b3401f03b7740e932e8ea7e
JavaScript
Abhishekduggal/javascript-toy-problems
/Array Built in Methods.js
UTF-8
584
4.8125
5
[]
no_license
var arr = [1, 2, 3]; //define an array arr contains elements 1 2 3 arr.push(4); //add element 4 to arr console.log(arr); //[1,2,3,4] arr.pop(); //remove the last element from arr console.log(arr); //[1,2,3] function getLength(arr) { //return length of arr return arr.length; } function getFirst(arr) { //return th...
true