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
c2d3109399e9c1684f2b12856ab55980d0a585e9
JavaScript
gorgo666/SPA
/src/views/treatments/gettreat-item.js
UTF-8
1,390
2.578125
3
[]
no_license
/** @format */ import $ from 'jquery'; import { Router } from '../../router/router'; import { Card } from '../../cart/cart'; export const treatListItem = (t) => { const router = new Router(); const card = new Card(); const div = $( `<div class="item" style="background-image: url(${t.url})"></div>` ); ...
true
c0769c8df50dc4befdfba65cccfd42351545e8b4
JavaScript
eokwukwe/sendIT
/client/js/login.js
UTF-8
2,112
2.625
3
[]
no_license
/* eslint-disable */ const logout = document.querySelectorAll('.logout'); const orderBtn = document.querySelectorAll('.order-btn'); const loginEmail = document.querySelector('#loginemail'); const loginPassword = document.querySelector('#loginpassword'); const loginSubmit = document.forms['login-form']; const snackbar =...
true
31c756cbbb050620d8191e3f3270a05dd6c20aab
JavaScript
eurolife/qd-todo-list
/hooks/useFilterTodos.js
UTF-8
670
2.53125
3
[]
no_license
import { useState } from 'react'; import { useSelector } from 'react-redux'; const useFilterTodos = () => { const todos = useSelector((state) => state.todos); const [filteredTodos, setFilteredTodos] = useState(todos) const filter = (filterType) => { switch (filterType) { case 'active': setFilt...
true
fb9b955cd614438012d6c4c638aec1a1e1619c58
JavaScript
wwELi/buildOwnAngular
/src/test_spec.js
UTF-8
378
2.84375
3
[]
no_license
import {sayHello} from './test.js'; describe('test', () => { it('s', () => { expect(sayHello()).toBe(22); let arr = ['a', 'b', 'c']; arr.forEach((item, index, array) => { if (item === 'b') { arr.splice(arr.indexOf('b'), 1); } con...
true
feb77ee92fa7fc06ed82e1df14b432d7e8ab00dc
JavaScript
itsep/lunch_planner
/shared/lib/error/unknown_error.js
UTF-8
1,194
2.640625
3
[]
no_license
const { LocalizableError } = require('./localizable_error') class UnknownError extends LocalizableError { /** * Converts a raw javascript error to an `UnknownError` if it is not already a `LocalizableError` * @param {error} error * @returns {LocalizableError} */ static convertIfNeeded(error) { if (...
true
a8d89413d4452bd221c3efe8746efdb18ca2f8b0
JavaScript
lindakwoo/challenges
/js/challenge-7/index.js
UTF-8
451
3.71875
4
[]
no_license
/* Daily Challenge 2/17/2020 Write a function which accepts an array of numbers and a target value. Find the two numbers in the input array which sum to the target value and return their INDICES. Each input set should contain exactly ONE result. A single number can NOT be counted twice. I...
true
6b8c3b820e80a5b4fa056d0e3be1838d13fac333
JavaScript
grzzywa/rambox-custom-code
/outlook-new-mail-notification.js
UTF-8
630
2.515625
3
[]
no_license
var excludeFolder = 'SpamBox'; function checkUnread() { var unreadMail = 0; jQuery.each($('div[role*=treeitem] .ms-fwt-sb'), function(name, elem){ var $element = jQuery(elem); var name = $element.parent().parent().children('.ms-fwt-sl').first().attr('title'); var val = parseInt($element.text()...
true
1d9be29c78bd106fc43a7cd7331418d45f3440a0
JavaScript
lypnol/adventofcode-2017
/day-07/part-1/ghigi123.js
UTF-8
637
2.671875
3
[ "MIT" ]
permissive
const _ = require('lodash'); run = s => { const lines = _.split(s, '\n'); const nodes = _.keyBy(_.map(lines, line => { const res = /^(\w+)\s*\((\d+)\)(?:\s*->\s+((?:,?\s*\w+)*))?$/gm.exec(line); return { id: res[1], weight: parseInt(res[2]), children: res[3] ...
true
7238e36d29981e220b4cb69f71ae3979a87291fd
JavaScript
aice09/tensurafan.github.io
/service-worker.js
UTF-8
2,240
2.78125
3
[ "MIT" ]
permissive
const URL_REGEX = /(href|src)=['"]([^'"]+)['"]|fetch\(['"]([^'"]+)['"]\)/gi const CACHE_NAME = "assets" async function makeRequestAndCachePathsRecursive(path, exploredPath = []){ if (exploredPath.some(cachedPath=>cachedPath === path)){ return } exploredPath.push(path) let resultingData = await intelegentFetch(p...
true
477bbd27a1658a75d0c113e3a703d4d735c86718
JavaScript
jessechoward/fastagi-webservice-gateway
/fastagi/session.js
UTF-8
8,948
2.515625
3
[ "MIT" ]
permissive
const EventEmitter = require('events').EventEmitter; const crypto = require('crypto'); const logger = require('../logging'); const EndOfVars = /\n\n$/; const EndOfMessage = /\n$/; const Hangup = /^HANGUP\s*$/gm; const ResponseMessage = /^(\d{3})(?:(?: result=(\S+)(.+\n)*)|(?:-(.*\n)))$/gm; const AgiVar = /^agi_(\S+): ...
true
49c5c0117683899804e368637f3999b8447e53c3
JavaScript
DavidLarsKetch/nss-exercises
/static-web/challenge-004/script.js
UTF-8
348
3.9375
4
[]
no_license
for (let i = 1; i < 10; i++) { let n = 1; while ((i % n) !== 0) { n++; } console.log("The lowest divisor for", i, "is", n); } console.log("Unless you want a more illuminating answer."); for (var i = 2; i < 10; i++) { let n = 2 while (i % n !== 0) { n++; } console.log("The lowest divisor for", ...
true
181fe1d4a4c3fce60426efa7446daa3295b340ef
JavaScript
hadley31/gnomebot
/src/commands/ascii.js
UTF-8
487
2.609375
3
[]
no_license
import logger from "../utilities/logger.js" import { ASCII_GNOMES } from "../constants.js" import _ from "lodash" export default { name: "ascii", desc: "Prints a random ascii gnome to the chat.", /** * * @param {import('discord.js').MessageInteraction} interaction */ async execute(interaction) { t...
true
449587b7015b0eb9027b7812073f681d8fbd60db
JavaScript
dtkb82/lhl-lectures
/w1d4-callbacks/request-example/index.js
UTF-8
849
4.0625
4
[]
no_license
// Example of callbacks used in asynchronous code // We'll talk more about this in future lectures var request = require('request'); // Loads the request package to pull data off the internet console.log("--- This is the very first thing in my program."); // Callback function to be used by request. We need to provid...
true
0cb1dbbe9da8dbd3d1a8aecee3b6d6128e1f2ad9
JavaScript
Vjp888/be-inquantifiable-selves-express
/serializers/meal_serializer.js
UTF-8
635
2.8125
3
[]
no_license
class MealSerializer { static async format(singleMeal) { // This is setting the meal attributes into result hash let result = { 'id': singleMeal.id, 'name': singleMeal.name } // This function pulls the attributes from the foods associations and mapping them to their keys await singleM...
true
a80e5df458d426caa7256e643c6094e6cc8269e2
JavaScript
rachaellinley/redux-lecture-project
/src/components/Login.js
UTF-8
1,272
2.609375
3
[]
no_license
import React, {Component} from 'react'; import {Link} from 'react-router-dom' import { connect } from "react-redux"; import {updateUsername} from "../redux/reducer" class Login extends Component { constructor() { super(); this.state = { username: '', password: '' } ...
true
2a76fca67fd343f19bbc2f0be33b7c0169d45da9
JavaScript
kamil109111/hydrapp
/src/js/index.js
UTF-8
924
2.75
3
[]
no_license
import "../scss/main.scss"; // uncomment the lines below to enable PWA import { registerSW } from "./pwa.js"; registerSW(); /* place your code below */ const glassCounter = document.querySelector(".glassCounter--js"); const addGlass = document.querySelector(".addGlass--js"); const deleteGlass = document.querySelecto...
true
38c813bbd3ad96ca892740b1142c96e1fa55a6a3
JavaScript
cadetCoder/FizzBuzz-challenge
/index.js
UTF-8
1,098
4.4375
4
[]
no_license
function fizzBuzz () { let MAX_NUMBER = 100; for (let numberToCheck = 1; numberToCheck <= MAX_NUMBER; numberToCheck++) { //I use two conditions in the if-statement to determine if it should print “Fizz Buzz”. We use a double ampersand, which means both conditions must be true. if ( isDivisibleBy3(numberTo...
true
fd28b73305f721e633d2be10089f4fceb4f31396
JavaScript
xzp201820210303/mindmap-fe
/代码/数据结构和算法/LinkedList/easy/middleNode.js
UTF-8
511
2.921875
3
[ "MIT" ]
permissive
/* * @Author: 蒋文斌 * @Date: 2021-03-13 11:54:03 * @LastEditors: 蒋文斌 * @LastEditTime: 2021-03-13 18:59:35 * @Description: 自动生成 */ // https://leetcode-cn.com/problems/middle-of-the-linked-list/ /** * 快慢指针还是好用 * @param {ListNode} head * @return {ListNode} */ var middleNode = function(head) { var slow = head...
true
cacb4e081e1365083e5a2f4cf34554172be154e3
JavaScript
amdelamar/oddox-dashboard
/src/filters/shorten.js
UTF-8
235
2.875
3
[ "Apache-2.0" ]
permissive
export function shorten (value, length) { if (!value && value !== null) return '' length = length != null ? length : 10 if (value.length > length) { return value.substring(0, length) + '...' } else { return value } }
true
c6d5961b2a1ed697c95534a2b04e796b7d798b0a
JavaScript
dave0xE7/tp
/src/opt/plug/core.js
UTF-8
1,619
2.5625
3
[]
no_license
/** * */ const fs = require('fs'); const child_process = require('child_process'); // function RunExec (cmd) { // child_process.exec(cmd, (e, stdout, stderr)=> { // if (e instanceof Error) { // console.error(e); // throw e; // } // console.log('stdout ', stdout); ...
true
37116a9243213f7bd2bf04441d79e62a9709ba87
JavaScript
AdamC66/Aug-20th-04---Tic-Tac-Toe
/ttt.js
UTF-8
1,658
3.6875
4
[]
no_license
function someoneWon(winner){ let table = document.querySelector('table') table.style.display='none' let header = document.querySelector('h1') header.innerText = (`${winner} Wins! Refresh to play again!`) } var checkforwinner = function(boxClicked){ console.log(typeof(boxClicked)) let boxes = d...
true
be3a869c824c099820a336d705aaba449bee3258
JavaScript
pritambiswas00/Comments-Posting-React
/src/Container/InputForm/InputForm.js
UTF-8
2,382
2.6875
3
[]
no_license
import React from 'react' import Input from '../../Components/Input' class InputForm extends React.Component{ state={ form: { name : { inputDetails:{ placeholder: 'Name', required : true, type : 'text' ...
true
7b68d92948e4b6d047eb32a5c4da49925f15aba4
JavaScript
deaf-ayo/courses
/alicea-courses/js-understanding-the-weird-parts/Section_4/11_Whitespace/app.js
UTF-8
286
3.328125
3
[ "MIT" ]
permissive
let // first name of the person fname, // last name of the person lname, // the language // can be 'en' or 'es' lang; let person = { //the first name fname: 'Jo', // the last name // (always required) lname: 'Red' } console.log(person)
true
c0739613eafeb9a1261fd1a7837b01e4a1d92bac
JavaScript
kg233/simhomeWebhook
/fulfillments/getMonthly.js
UTF-8
1,289
3.3125
3
[]
no_license
//getMonthly.js //use api to get the monthly total energy usage and return it in a readable string //will further prompt the user to get the top 3 usage using getTop3.js const monthPeriod = require('../utils/monthPeriod'); const roundKWh = require('../utils/roundKWh'); const axios = require('axios'); async function g...
true
2a6f27782a0653458948c8d424f0a8715f8e7e8a
JavaScript
mouhsinelonly/el-student-spa
/src/hooks/useGetCountryName.js
UTF-8
526
2.609375
3
[ "MIT" ]
permissive
// @flow import { useState, useEffect } from 'react' import { useSelector } from 'react-redux' const useGetCountryName = (countryId: number): Function => { const [ object, setName ] = useState() const { data: countries } = useSelector((state: Object): Object => (state.countries)) useEffect(() => { const name ...
true
4390fb0bf45b32e22a297a302850973abee5816c
JavaScript
adobe/twist
/test/internal/utils/ObjectUtilsTest.jsx
UTF-8
3,413
2.65625
3
[ "Apache-2.0" ]
permissive
/* * Copyright 2017 Adobe Systems Incorporated. All rights reserved. * This file is licensed to you 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 * *...
true
b5d9ae8f9322964b76d69b979a9ccb235b018ab0
JavaScript
Rudy-Castan-DigiPen-Teaching/cs099-final-project-make-a-game-JeminShin2
/Note.js
UTF-8
630
3.21875
3
[]
no_license
// Name : Jemin.Shin // Assignment : Make a Game // Course : CS099 // Spring 2021 class Note { constructor(X,Y,hide_speed,spawn) { this.X = X this.Y = Y this.hide_speed = hide_speed this.time = millis() this.spawn = spawn-2000 this.Life = 30 } draw() { this.time = mil...
true
b6df8916276114a8f3a0b2ff8e08fccc80e0465c
JavaScript
julienbck/tictactoe-game
/src/Board.js
UTF-8
4,217
2.703125
3
[]
no_license
import React, { Component } from 'react'; import './Board.css'; import Logo from './logo.gif' import Announcement from './Announcement.js'; import ResetButton from './ResetButton.js'; import Tile from './Tile.js'; import ResetButtonScore from './ResetButtonScore.js'; class Board extends Component { constructor(prop...
true
03e46379627c84b64b5284fb70b917f730431673
JavaScript
jbarrus/protractor-memory
/lib/d3graph.js
UTF-8
4,873
2.859375
3
[ "MIT" ]
permissive
'use strict'; var d3 = require('d3'); var _ = require('lodash'); /** * d3graph, a function to generate a line graph of for an array of objects. * @param results - * @param points - array of objects containing the line name and the corresponding array of values: eg. [{name: 'Example', values: [1,2,3]}] * @param un...
true
da6c6bff53416ed598fd85c9e19af5bc84d13d29
JavaScript
bioub/Formation_ST_Web_Advanced_2020_12
/React/hello-react/src/TodoList.js
UTF-8
3,860
3.078125
3
[]
no_license
import { Component } from "react"; class TodoList extends Component { state = { newTodo: "ABC", todos: [ { id: 1, title: "Acheter du pain", completed: false, }, { id: 2, title: "Introduire Express", completed: true, }, ], }; hand...
true
d39a43efa7758f9b82c666cd4c7e67b3a034a0df
JavaScript
jonschlinkert/exponential-moving-average
/test.js
UTF-8
1,648
2.921875
3
[ "MIT" ]
permissive
'use strict'; require('mocha'); var assert = require('assert'); var ema = require('./'); describe('exponential-moving-average', function() { it('should export a function', function() { assert.equal(typeof ema, 'function'); }); it('should throw an error when array is not passed', function() { assert.thr...
true
316ee61e3d521c70086da2e9c37ecf369d6ae63e
JavaScript
anittarj/mearnstackworks
/javascript_works/limit.js
UTF-8
306
4
4
[]
no_license
// var num3; // low=8 upper=27 // 1**3=3 // 2**3=8 print 2 // 3**3=27 print 3 var num = 2, lower = 8, upper = 27; for (let i = 1; i <= upper; i++) { let res = i ** num; if (res > upper) { break; } if ((res >= lower) & (res <= upper)) { console.log(i); } }
true
6a3ec038466a6142745c50f863d573a5793f413b
JavaScript
christvalt/Unilibrary
/src/backend/src/routes/author/author.js
UTF-8
2,249
2.59375
3
[]
no_license
var express = require("express"); const router = express.Router(); const Author = require("../../models/authormodel/autormodel"); //new actor router.get("/new_actor",(req,res)=>{ res.render('author/new_actor',{author:new Author()}) }); //crete actor router.post ("/",async (req,res)=>{ const author= new Au...
true
771b09d167c39031bd8e6b7747ce56464ec0bc3f
JavaScript
LuisGarijo/DSM-2017-Garijo-Iribarren-PracFinal
/documentstruct.js
UTF-8
518
2.546875
3
[]
no_license
var mongoose = require('mongoose'); var Schema = mongoose.Schema; // modelo no relacional de lo que vamos a almacenar en la base de datos // STRUCTURE FOR DIFFERENT ORM(OBJECT RELATIONAL MAPPING) // FOR USERS var User = new Schema ({ // creamos el ORM (el modelo de los datos) tipo JSON firstname: String, lastname...
true
fdf93425cb9aaa364722945c9df05af4c20edc0a
JavaScript
floscr/node-symlink-tool
/lib/utils.js
UTF-8
180
2.5625
3
[]
no_license
export function log (object) { console.log(JSON.stringify(object, null, 2)) } log.bind(console.log) export function logErr (err) { console.err(err) } logErr.bind(console.log)
true
411994518cc0b7bb6d7cf0f7bd11a7e454c1d918
JavaScript
williamtcastro/pokedex-react
/src/components/PaginationList.js
UTF-8
1,192
2.609375
3
[ "MIT" ]
permissive
import React, {Component} from "react"; import './App.css'; export default class PaginationList extends Component { render() { let limit = 60; let page_list = []; // console.log(this.props.pokemonCount) let loop_i = this.props.pokemonCount / limit; var min = 0; var m...
true
0de0d8a8ae22f49d6720a0bd33296bc195664047
JavaScript
menocu/p5-sketches
/01_quickdraw-bday/sketch.js
UTF-8
2,102
3.0625
3
[]
no_license
const url = 'https://quickdrawfiles.appspot.com/drawing/cat?isAnimated=false&format=json&key=' let strokeIndex = 0; let index = 0; let cat; let prevx, prevy; let keyInput; let start; var num_cats = 0; var target = 360; var cats = []; function setup() { createCanvas(1000, 1250, SVG); //background(20); newCat(); ...
true
1b487cb475dc615d3167e45c91203bf7581399cd
JavaScript
id1945/reactjs-basic-project-structure
/src/utils/price-formater.js
UTF-8
751
3.625
4
[]
no_license
/** * This function get a number and separate triple with separator char * * @param {number} price * @param {string} separator * @return {string} */ export default function priceFormatter(price, separator = ',') { if (price == null) return '' let tmp_price = [], tmp_c = 1; price = pri...
true
1a9f8e228e13a22f57cb8afbc4971a8ae78ae4fe
JavaScript
viterijose/The-Store
/manager.js
UTF-8
5,939
2.78125
3
[]
no_license
var mysql = require('mysql'); var inquirer = require('inquirer'); var connection = mysql.createConnection({ host: "localhost", port: 3306, user: "root", //Your username password: "CROCODILE1a", //Your password database: "bamazon" }) connection.connect(function (err) { if (err) throw err; c...
true
e3776d16c8f4942977cd780f873890fec2378894
JavaScript
tnakanda/finalProject
/public/main.js
UTF-8
966
2.78125
3
[]
no_license
/*Global Fetch*/ var update = document.getElementById('update') var del = document.getElementById('delete') update.addEventListener('click', function () { fetch('restaurants', { method: 'put', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ 'name':...
true
7fe446fd7cf7847631fa326f3f2a03eb69b2e920
JavaScript
rhahne/iron-impression
/public/javascripts/script.js
UTF-8
2,376
2.59375
3
[]
no_license
// NavBar Burger document.addEventListener('DOMContentLoaded', () => { // Get all "navbar-burger" elements const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0); // Check if there are any navbar burgers if ($navbarBurgers.length > 0) { // Add a clic...
true
cf36c939c6ba1dc6a75d1778e102fd06f81639d4
JavaScript
jpotterm/playground
/spring-js/js/util.js
UTF-8
3,582
3
3
[]
no_license
(() => { class Simulation { constructor(stepInterval, callback) { this.stepInterval = stepInterval; this.callback = callback; this.requestId = null; this.previousTime = null; this.timeStore = 0; this.step = this.step.bind(this); ...
true
eb767d15f66625f26904eb690f2c533524065b76
JavaScript
SemihDurmus/CodinGame_JS_Exercises
/CodinGame/16_printChars.js
UTF-8
442
3.765625
4
[]
no_license
console.log("--------------Print Chars----------------"); const E = "1# 2O 4$ 12+"; const D = E.split(" "); let ans = ""; function seperateNr(str) { var res = []; var matches = str.match(/(\d+)/); res.push(parseInt(matches[0])); let ch = str.slice(-1); res.push(ch); return res; } for (const element of D) ...
true
93eb815ede7a02fdbe0265cd00a6066b4e6083b5
JavaScript
Sol-Zeta/programacion-avanzada-promises
/JS/callback.js
UTF-8
1,452
3.40625
3
[]
no_license
// Un ApiKey es una llave para usar una api de internet, algunas son de pago y otras son gratuitas // Sirven para limitar el número de peticiones por desarrollador // Para conseguir un API KEY visita: https://home.openweathermap.org/api_keys const WEATHER_API_KEY = ""; /** * This function will always return a `Promis...
true
0da7b9d136a0c754aa6e9265a60a61508f273fa7
JavaScript
sumantchauhan/interview
/index.js
UTF-8
3,341
4.15625
4
[]
no_license
const log = console.log; // console.log("This in global", this); //This in global {} // console.log("this", this === global); //this false but in node true function f1() { return this; } // log(f1() === globalThis); // true; function checkThis() { log("this inside normal function", this); //global: [Circular]...
true
02ed1e51635020cf980062a2340230bc97860a74
JavaScript
chloebates4/CS413_Puzzles
/js/game.js
UTF-8
5,371
2.84375
3
[]
no_license
// load main menu var gameport = document.getElementById("menu"); //bootstrapping pixi.js var renderer = PIXI.autoDetectRenderer({transparent: true}); gameport.appendChild(renderer.view); var bump = new Bump(PIXI); //root of scene graph var stage = new PIXI.Container(); var texture = PIXI.Texture.from("assets/leaves_...
true
3b8b1b3d9f3c7452bc8c15599804173e0c6cd538
JavaScript
JaredEvansNC/IterativeGame
/leave_these_alone/ui/endscreen.js
UTF-8
956
2.5625
3
[]
no_license
class EndScreen extends ScreenBase { constructor() { super(); // Make a title ui.makeText(this, "GAME OVER", app.SCREEN_WIDTH / 2, 100, ui.titleFont.font, ui.titleFont.color); // Show num clicks again ui.makeText(this, "TOTAL COINS\n" + app.score, app.SCREEN_WIDTH / 2...
true
c65620e8e4704baffc979d601e8a1073025270e4
JavaScript
SIMRAN88/JavaScript30
/weather-app/index.js
UTF-8
17,992
2.875
3
[]
no_license
//----------------------------------------------declaration //start var appKey = "0788dd95700ca36127955d1776db92e8"; var searchButton = document.getElementById("searchBtn"); var searchInput = document.getElementById("searchTxt"); var cityName = document.getElementById("cityName"); var icon = document.getElementById("i...
true
9c996cfd442aa6adad5bc342f0801ab81fb4f842
JavaScript
mapbox/kml-split
/index.js
UTF-8
2,213
2.53125
3
[ "ISC" ]
permissive
'use strict'; var gdal = require('gdal'); var path = require('path'); function kmlSplit(file, options, callback) { if (!callback && typeof options === 'function') { var callback = options; } var paths = file.split('/'); var sourceName = path.basename(file, '.kml'); var outDir = options.outDir || file....
true
979d476f5964fec03c6f8b95e04b02da6ab95522
JavaScript
Koutouzosm/Movie-mate
/public/assets/js/app.js
UTF-8
4,948
2.890625
3
[]
no_license
function signUp(event) { event.preventDefault(); const userData = { firstName: $('#first-name-input') .val() .trim(), lastName: $('#last-name-input') .val() .trim(), userName: $('#username-input') .val() .trim(), email: $('#email-input') .val() .trim(...
true
f2fd785dcc5fedc2531fa262530be78e5075b563
JavaScript
FoushWare/ginit
/index.js
UTF-8
2,928
2.875
3
[ "MIT" ]
permissive
#!/usr/bin/env node const chalk = require("chalk"); const clear = require("clear"); const figlet = require("figlet"); const files = require("./lib/files"); const github = require("./lib/github"); const repo = require("./lib/repo"); // const inquirer = require("./lib/inquirer"); /** * chalk — colorizes the outpu...
true
2feaf2f1677c289188187eadd094010c1a8e5c6d
JavaScript
Jinnalee/eun
/Colours.js
UTF-8
1,362
3.3125
3
[]
no_license
var ColourSet = { Body : function(color){ // document.querySelector('body').style.color = color $('body').css('color', color); }, Bodybg : function(color){ //document.querySelector('body').style.backgroundColor = color $('body').cs...
true
7ddead85cae0b9b16590e7314c537f95dd528873
JavaScript
nicolaseschneider/algo_practice
/bloomberg/substrings/substrings.js
UTF-8
725
4.28125
4
[]
no_license
// Given a string print all subsets (not permutations) // Eg. String "abc" should output // empty string // a // b // c // ab // bc // ac // abc // CANT DO FOREACH ON A STRING IN JS const stringSubset = (string) => { const result = []; helper(string, result, [], 0); return result; } const helper = (string, resA...
true
68702a537f82b61cd049847aa45a832a52b72eb6
JavaScript
SeongsangCHO/42FrontEnd
/JS/ch05/ch5.js
UTF-8
468
3.875
4
[]
no_license
let arr = ["I", "study", "Javascript", "right", "now"]; arr.splice(0, 3, "Let's", "dance"); console.log(arr); let removed = arr.splice(0, 2); console.log(removed); console.log(arr); arr.splice(2, 0, "Add1", "Add2") console.log(arr); let num = [1, 2, 5]; //인덱스가 음수일 경우 배열의 맨 끝부터 시작 num.splice(-1, 1); console.log...
true
1b77038630ca7855e32b19c2f60774034637f0f1
JavaScript
iefserge/typeutils
/test.js
UTF-8
5,207
2.890625
3
[ "Apache-2.0" ]
permissive
'use strict'; var test = require('tape'); var typeutils = require('./'); test('isUndefined', function(t) { t.equal(typeutils.isUndefined(), true); t.equal(typeutils.isUndefined(void 0), true); t.equal(typeutils.isUndefined(true), false); t.equal(typeutils.isUndefined(false), false); t.equal(typeutils.isUndef...
true
6ce6329f4f4d21bc0b41718f7bb9a1086d21061f
JavaScript
henrynkoh/UCD_ECS162
/Practice - Grandma shopping list/script.js
UTF-8
587
3.140625
3
[]
no_license
function display(gList){ let theList = document.getElementById("gransList"); for (let i in gList){ let newItem = document.createElement("li"); newItem.textContent = gList[i]; theList.appendChild(newItem); } } getListFromServer(); function getListFromServer(){ let url = "shoppingList"; let xhr = new XMLHtt...
true
ab0329a10e20e2046ac0127eef6ca65d0d03ef45
JavaScript
bendorshai/chess-replay
/src/main.js
UTF-8
1,383
2.6875
3
[]
no_license
let turn = 0; let moves; $(document).ready(function() { document.initView(); document.board = initBoard(); drawBoard(); // TODO: implement on update const log = "1. e4 d5 2. e5 e6 3. Nf3 Nc6 4. d4 h6 5. Bb5 Bd7 6. c4 dxc4 7. Bxc4 f6 8. exf6 Qxf6 9. O-O Bd6 10. Nc3 a6 11. Re1 Na5 12. Ne4 Qg6 13. N...
true
7be045f163b6165e59366d790b017b22c4e5d8ee
JavaScript
rostyslavDoskochynskiy/WeatherApp
/src/reducers/authReducer.js
UTF-8
1,724
2.5625
3
[]
no_license
import { AUTH_START, AUTH_FAILED, AUTH_SUCCESS, SIGN_UP, SIGN_IN_START, SIGN_IN_FAILED, SIGN_IN_SUCCESS, LOG_OUT } from "../actions/types"; const initialState = { user: null, userRegistered: {}, loggedIn: false, initialChecking: true, isReg: false, error: null, loading: true }; const red...
true
73005ad983186b2dd246a5d2e6f7a7e1a2d12a4b
JavaScript
muskanmahajan37/AdventOfCode2018
/js/day/15-pass-2.js
UTF-8
8,356
2.984375
3
[]
no_license
// 206236 // 88537 importScripts('./../baseWorker.js'); onmessage = onmessagefunc((input, callback) => { let result = [ null, null ]; let elves = []; let goblins = []; let units = []; let dead = []; let createUnit = (x, y, type) => { let unit = { x: x, y: y, pow: 3, hp: 200, type: type }; ((type === 'E...
true
68301bee717ea10096e7268cc01bf5a9dd0aaa25
JavaScript
mirek/tsql
/inline-table-of-column.js
UTF-8
855
2.59375
3
[ "MIT" ]
permissive
// @flow const { inspect } = require('util') const id = require('./identifier') const list = require('./list') const row = require('./row') const tsql = require('./template') /*:: import S from './sanitised' import Sid from './sanitised-identifier' */ /** @returns literal table from provided values. @throws if...
true
3d853afd825cfce9088f638e0e105ed594184325
JavaScript
wanghangit/algorithm4-javascript
/sort/insertSort.js
UTF-8
884
3.328125
3
[]
no_license
const { swap } = require("../util"); /** * 插入排序 * 也是一种O(n^2)效率的算法 * 就像插扑克牌一样每次都都把数字插入到合适的顺序 * 对于近乎有序的数组效率比较高最优能再O(n)的情况下完成 * 是很多复杂算法在递归过程中,数量较少时的选择的优化处理方法 * @param {*} array */ function insertSort(array) { let len = array.length; for (let i = 1; i < len; i++) { let j = i; let target = array[j--]; //...
true
70869ce580c72912de8c0c0296dce52d6884f012
JavaScript
even-lq/lq_fullstack
/js/vue/my-vuex/src/store/myVuex.js
UTF-8
2,332
2.859375
3
[]
no_license
let Vue = null; class Store { constructor (options) { // this.state = options.state || {} this.vm = new Vue({ data: { state: options.state } }) let getters = options.getters || {} // 没搞懂为什么要多一个let getters出来,直接用 this.getters不行? this.getters = {} // 取到options.getters里面的所有...
true
8c110b4024cb3895e116c246d2e710c79569363f
JavaScript
lloyd/node-cpusage
/index.js
UTF-8
1,887
2.75
3
[ "WTFPL" ]
permissive
const getrusage = require('getrusage'), events = require('events'); // constants const eventsEmitted = [ 'busy', 'normal', 'stats' ]; const POLL_PERIOD_MS = 2000; var HIGH_WATER_MARK = 80.0; // state var polling = false; var timer = null; // api module.exports = new events.EventEmitter(); module.exports._on = m...
true
590ba07bd321a4b8cf0162c872e505ff10be2467
JavaScript
Pooja-C6/BookManagement-SinglePage
/addBooks.js
UTF-8
12,440
2.96875
3
[]
no_license
var Book = /** @class */ (function () { function Book(id, title, author, ratings, cost) { this.id = id; this.title = title; this.author = author; this.ratings = ratings; this.cost = cost; } Book.prototype.setId = function (id) { this.id = id; }; Book.p...
true
bc73b2bbf98d68b228150bb3156d8fae67826046
JavaScript
codeexpress333/Throw-Text-Animation
/main.js
UTF-8
1,557
2.65625
3
[]
no_license
//Get All Value var container = {}; container.opacityIn = [0, 1]; container.scaleIn = [0.2, 1]; container.scaleOut = 3; container.durationIn = 800; container.durationOut = 600; container.delay = 500; //Now Start Animation anime.timeline({ loop: true }) .add({ targets: '.container .letters-1',...
true
f69af303a1022835a5bf95a9b0ca3e6b218ebc42
JavaScript
Mc-Guire/flicktionary-1
/public/script.js
UTF-8
26,860
2.890625
3
[]
no_license
// This is the list of variables being set. pagePos is set to 3, //amountPages is set to 1, allResults is all possible results of a search, //searchType is for searching movies, numSeries is setting the number of series to 0 and numEpisodes is setting the number of episodes to 0, //seriesSelected and episodeSelected is...
true
f2d56210e990d19a3721876d0c0fc0b8004140c1
JavaScript
skDn/mygithubpage
/src/components/TweetEmbed.js
UTF-8
1,212
2.625
3
[ "MIT" ]
permissive
// # react-tweet-embed // ## Install // ``` // npm i react-tweet-embed // #or // jspm i npm:react-tweet-embed // ``` // ## Usage // ```javascript // import TweetEmbed from 'react-tweet-embed' // <TweetEmbed id='692527862369357824'></TweetEmbed> // ``` // You don't have to put `//platform.twitter.com/widgets.js` in...
true
a41cc5e750d846f3d6d81b41f39829a7c5ee95a7
JavaScript
juanghurtado/todomvc-marionette
/test/specs/todo/views/footer.spec.js
UTF-8
5,582
2.65625
3
[]
no_license
define([ 'modules/todo/views/footer', 'modules/todo/collections/todos', 'utils/communication-bus', ], function(FooterView, Todos, CommunicationBus) { describe("TO-DO footer view", function() { /* =HELPERS --------------------------------------------------------------------------- */ var _todos; ...
true
1ee02c1af901731c874909c8515e38025dc94b6c
JavaScript
Hakkyun/uictPractice
/myBoard/src/main/webapp/resources/js/ajax.js
UTF-8
4,322
2.78125
3
[]
no_license
// 게시판 리스트 불러오기 function getList(){ $('#getList').css("display", "none"); $('#hideList').css("display", "block"); $.ajax({ url : '/ajaxBoard.do', contentType : "application/json; charset=utf-8", success : function(data){ $.each(data, function(key, value){ $('#boardArea').append( `<tr ...
true
f88bbbed45bb27755ab9d30c00600f325ab8a3e1
JavaScript
Strvm/Escape-Game
/scripts/safeVault.js
UTF-8
3,781
2.859375
3
[]
no_license
"use strict" { const { setFoundKey, getRoomId, getCurrentRoom, playSound } = ESCAPE_ROOM; const pin = 810 let enterCode = ''; let isUnlocked = false; document.querySelector('.pincode').addEventListener('click', (event) => { if (event.target.className.inc...
true
e5ff901d6e5d2e5ff0287f2d46baf9b2dc157a81
JavaScript
nurhasanfadilasalam/sismo
/public/js/custom.js
UTF-8
494
3.125
3
[ "MIT" ]
permissive
/** * * You can write your JS code here, DO NOT touch the default style file * because it will make it harder for you to update. * */ "use strict"; function convertToRp(angka) { let rupiah = ''; const angkarev = angka ? angka.toString().split('').reverse().join('') : 0; for (let i = 0; i < angkarev....
true
85c4b3ffa1ce78646ed44c56af9955caf9e5cb2b
JavaScript
Bhanupandeydev/SmartWikiCode
/commands/Config/setmuterole.js
UTF-8
1,992
2.609375
3
[]
no_license
const db = require('quick.db'); const config = require('../../config.json'); const emotes = require('../../configs/emotes.json'); module.exports = { name: 'setmuterole', aliases: ['setmute', 'smrole', 'smr'], description: 'Sets A Mute Role For Muted Users!', usage: '[role name | role mention | role ID]', ...
true
8a94b1eaed9bd106a6e374cd82f400afb494862e
JavaScript
stats-app/dashboard
/application/ChartCreator.js
UTF-8
1,513
2.765625
3
[]
no_license
/** * Created by tom on 18/03/15. */ module.exports = function() { "use strict"; this.getChartObject = function( testData ) { if( typeof testData.length == 'undefined' || !testData.length || typeof testData[0].values == 'undefined' ) { return {} } var metricNames = []...
true
c02d31a217af8e9aac26e0f406e8b46121dc5b97
JavaScript
babel/babel
/packages/babel-plugin-transform-parameters/test/fixtures/regression/11303/exec.js
UTF-8
83
2.609375
3
[ "MIT" ]
permissive
function test(a, b = 1) { var a = a + b; return a; } expect(test(2)).toBe(3);
true
f791772922f4dad2145bb7def9931fd4a52a2458
JavaScript
dwblair/farmer-node
/make-fake-data.js
UTF-8
626
3.34375
3
[]
no_license
#!/usr/bin/env node const fs = require('fs') var timeStamp = Math.floor(Date.now() / 1000) var x=Math.round(Math.random()*1000) var y=Math.round(Math.random()*1000) if(fs.existsSync('data.txt')) { // data file exists; append data to it let rows=[] rows.push(`${timeStamp},${x},${y}`) let output = rows.join("\n") out...
true
232f9f757b1fd5ad3c48dfe3de5295663e0e11a4
JavaScript
panshihua/-Git-
/edgeDetection.js
UTF-8
5,342
3.25
3
[]
no_license
// 小球的边界检测:碰到边界后 ,方向为反向;并且 返回 小球的位置 与 颜色值的索引; function getPosition(x,y,cnv,speed,angle,ball_r,colors) { //参数的含义 依次为:球的圆心、cnv、速度、速度角度、球体半径、颜色、加速度、加速度角度、速度水平/垂直分速度、颜色索引。 // 垂直弹性系数、水平弹性系数、水平摩擦系数、垂直摩擦系数; // 速度代表数值、速度角度代表方向:方向按照W3C标准,可以轻松获取在水平/垂直方向上的分速度,这样分速度本身就带有正负; //加速度代表数值、加速度角度代表方向:方向按照W3C标准,可以轻松获取在水平/垂直方向上的分加速度,这样...
true
f7617cfbb7a77a1382e5ca7c028350cb4b2f749b
JavaScript
Ankin-IT/jianshu
/src/common/header/store/reducer.js
UTF-8
555
2.53125
3
[]
no_license
import * as constants from './constants'; import { fromJS } from 'immutable'; const defaultState = fromJS({ focused: '头部', list:[ {name:'jack'}, {name:'lucy'} ] }); export default (state = defaultState, action )=>{ if(action.type === constants.SEACTCH_FOCUS){ return state.set('focused','还是头部') // r...
true
0eb608af1081a46fa1dc875dd79e05b1e78eff02
JavaScript
Ropynn/node
/day1/04核心模块之文件模块.js
UTF-8
1,850
3.828125
4
[]
no_license
//文件模块:用来帮助我们操作文件 //由于核心模块属于一个单独的模块,所以我们在使用之前需要引用这个核心模块 var fs = require("fs");//引用文件操作核心模块 //在fs核心 模块中,有一个方法可以用来读取文件中的内容 // fs.readFile // 这个方法有两个参数: // 参数一:要读取文件的路径 // 参数二:读取后的回调函数 // 回调函数也有两个参数: // 参数一:当读取失败时的错误信息 // 参数二:读取出来的内容,读取出来的内容不会直接以字符串的...
true
c1901851f40edd732aecb2f63b3f6bf391716095
JavaScript
ampersky86/SpeedGlo
/main.js
UTF-8
5,131
3.015625
3
[]
no_license
const score = document.querySelector('.score'), start = document.querySelector('.start'), gameArea = document.querySelector('.gameArea'), car = document.createElement('div'); car.classList.add('car'); start.addEventListener('click', startGame); document.addEventListener('keydown', startRun); document.addEv...
true
2c3fe83d696f26243832a33696150073fe4fef7e
JavaScript
grunmouse/nomography
/js/rational-number.js
UTF-8
5,611
2.765625
3
[]
no_license
const { operators:{ add, sub, neg, div, mul, pow, eq, lt, gt, le, ge } } = require('@grunmouse/multioperator-ariphmetic'); const { bigint, float64 } = require('@grunmouse/binary'); /** * @param a : BigInt * @param m : BigInt */ function mfloor(a, m){ return (a/m)*m; } function mceil(a...
true
e5968e2c18697fe252c697f8e078984e80e18640
JavaScript
r-petrov/JavaScript-Basics-Course
/Homeworks-Exercises-and-Exam/Exam-preparation/27-July-2014/2.RevealTriangles/reveal-triangles.js
UTF-8
1,445
3.734375
4
[]
no_license
/** * Created by PC on 19.01.2016 г.. */ function solve(arr) { "use strict"; var inputArray = []; var outputArray = []; for (var lineIndex in arr) { var charArray = arr[lineIndex]; inputArray.push(charArray.split('')); outputArray.push(charArray.split('')) } function r...
true
ddea528c6f39592cbf0e31ea5f479983b6e5d17b
JavaScript
noahsug/blackjack-trainer
/src/engine.test.js
UTF-8
2,740
3.078125
3
[]
no_license
import engine, { cards, getAnswer, interestingness } from './engine'; it('generates player two cards', () => { const { playerCards } = engine.getBoard(); expect(playerCards.length).toBe(2); playerCards.forEach((card) => { expect(cards.includes(card)).toBe(true); }); }); it('generates a dealer card', () =>...
true
4aa72205cff91e7a79c62e1d7a188434bcfc6e87
JavaScript
AnnaRoos/recursion-exercises
/binarySearchTrees.js
UTF-8
1,321
4.25
4
[]
no_license
// Node class export class Node { constructor(data) { this.data = data; this.left = null; this.right = null; } } // Binary Search tree class export class BinarySearchTree { constructor() { this.root = null; } } //Binary search tree const insertValueToBinarySearchTree = (root, data) => { if ...
true
733a397c13d9adb5d9b7c1f01e2964ba11abf128
JavaScript
mohanadefm/todo-list
/src/components/Form.js
UTF-8
1,444
2.71875
3
[]
no_license
import React, { useState } from "react"; function Form({ addTodo, list }) { const [inputValue, setInputValue] = useState(""); const handleInputChange = (e) => { setInputValue(e.target.value); }; const handleFormSubmit = (e) => { e.preventDefault(); if (inputValue.trim() === "") return; // or (inp...
true
e74c38d4b26ea0b3d782ef89936189a6fe8c95ad
JavaScript
Eonm/Make-MD-electron
/scripts/open-helper.js
UTF-8
2,233
2.546875
3
[ "MIT" ]
permissive
const {dialog} = require('electron').remote; const {shell} = require('electron'); function openFileYml (e, element) { const defaultPath = document.getElementById("path").innerHTML; e.preventDefault(); dialog.showOpenDialog({ properties: ['openFile'], defaultPath: defaultPath, filters: [ { name...
true
e2a1f0579edab553d157612322f1dc98cb5d4e96
JavaScript
andromedarabbit/timemachine
/lib/facebook.js
UTF-8
3,795
2.546875
3
[]
no_license
"use strict"; const winston = require('winston'), url = require('url'), querystring = require('querystring'), util = require('util'), timestamp = require('unix-timestamp'), config = require('../config'); var getFacebookApp = function () { var FB = require('fb'); FB.options({version: 'v2.8'...
true
0b62cd97779e2d17582f0cc447e7974535b240db
JavaScript
serg-if1976/serg-if1976.github.io
/jq_todolist/todolist.js
UTF-8
306
2.90625
3
[ "MIT" ]
permissive
$(document).ready(function() { $("#add").click(function() { if ($("#task").val() == "") return; $("#tasks").append("<li>" + $("#task").val() + "</li>"); $("#task").val(""); }); $("#tasks").on("click", "li", function() { $(this).toggleClass("done"); }); });
true
4f4376d19833f6715adb4a73660701ff4cb4e88f
JavaScript
maryguada/MEAN_Stack
/Restaurant_Reviewer/server.js
UTF-8
5,035
2.703125
3
[]
no_license
// =========== REQUIRE MODULES ============== const express = require('express'); const app = express(); const bodyParser = require('body-parser'); const mongoose = require('mongoose'); const flash = require('express-flash'); const path = require("path"); const port = 8000; app.use(bodyParser.urlencoded({ extended: t...
true
985a749005fc6bacbccd62aa0e9e2aa4e8f71e64
JavaScript
Nenarochkin/mycite
/HTML5Application/public_html/js/myscript.js
UTF-8
4,656
3.015625
3
[ "MIT" ]
permissive
window.onload =()=> { console.log('Hi'); let f=new Favorite(); }; class Favorite { constructor() { this.hearts=document.getElementById("hearts"); this.reg=document.getElementById('reg'); this.enter=document.getElementById('en...
true
f703b6041f545264e4be77851c9233c99ae5aa13
JavaScript
Rashidikn1/CS-411
/411project/src/components/recipeList.component.js
UTF-8
2,272
2.703125
3
[]
no_license
import React, { Component } from "react"; import Card from "react-bootstrap/Card"; import Button from "react-bootstrap/Button"; /** * RecipeList Component * * this component is in charge of rendering out the grid of recipes. All changes to that section are done here * The recipe grid is re-rendered every time that...
true
83ed66c517c1e235ecc7d40ff0e6296bdbf8b1d2
JavaScript
ivanababictech/redux-saga
/actions/activity.js
UTF-8
2,240
2.8125
3
[]
no_license
// @flow import { ACTIVITY_MESSAGES_LIMIT } from '../global/Constants'; import { type ActivityLogMessage } from '../types/ActivityLogMessage'; type MessageAddedAction = { +type: 'MESSAGE_ADDED', +message: ActivityLogMessage }; type StartFetchMessagesAction = { +type: 'START_FETCH_MESSAGES', +limit: number }; type Don...
true
28dbddeb0c79829f23dda7d0f80f33e3cc0d7d99
JavaScript
meganamarshall/webpack-setup
/src/writer.js
UTF-8
250
2.59375
3
[]
no_license
const fs = require('fs'); const writer = (str, path) => { fs.writeFileSync(path, str, 'utf8'); }; const writeJSON = (obj, path) => { fs.writeFileSync(path, JSON.stringify(obj, null, 2), 'utf8'); }; module.exports = { writer, writeJSON };
true
aaafcb030eb27a665276edc9e07495774e86f5a6
JavaScript
jocomail78/js-barcode-reader
/js/ui.js
UTF-8
234
2.8125
3
[]
no_license
$(document).ready(function(){ $(".btn").click(function(){ start = $("#startbpm").val(); end = $("#endbpm").val(); diff = (end*100/start)-100; $(".transfer").html(diff.toFixed(2)+"%"); }); });
true
0bbcfbaaa9acb86fe46c3de4933f354f8bdf0144
JavaScript
LeeWayne/WDI8_Day_Work
/todo_list_app_start/app/assets/javascripts/tasks.js
UTF-8
1,648
3.59375
4
[]
no_license
// Add New Task to the list // Create task in the DB // Destroy task // Change task status // Get all the tasks // Define functions // Write code for document ready $(function(){}) function request(method, url, data) { return $.ajax({ method: method, url: url, dataType: "json", data: data }); } ...
true
971aa6ccfde1d9bd7418b0f2ed5ba11b93188810
JavaScript
mengjin/lighthouse
/lighthouse-core/report/v2/renderer/details-renderer.js
UTF-8
2,466
2.84375
3
[ "Apache-2.0" ]
permissive
/** * Copyright 2017 Google Inc. All rights reserved. * * 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 applic...
true
4808485f19420407304940f3bb21b300af14271f
JavaScript
kimsintae/DreamGo-ver0.2-
/src/main/webapp/resources/js/list.js
UTF-8
946
2.703125
3
[]
no_license
$(document).ready(function () { //jquey로 파라미터 값 가져오기 $.extend({ getUrlVars: function () { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for (var i = 0; i...
true
710f94e864e7226ba7bbaeeab1117e67f14871f9
JavaScript
mjmoon608/sparta
/2일차/homework/LoadData.js
UTF-8
398
2.796875
3
[]
no_license
$(document).ready(function () { //alert("다 로딩됐다!"); // 여기에 환율 API Ajax 요청을 하면 되겠죠? const $exchangeRate = $("#exchangeRate"); $.ajax({ type: "GET", url: "https://api.manana.kr/exchange/rate.json", data: {}, success: function (response) { // alert(response[1]["rate"]); $exchangeRate.te...
true
08981df8b248b12e4d1cc931c3c9f9a7b8c0948a
JavaScript
JeissonSerpa/clima
/src/components/Clima.js
UTF-8
979
2.671875
3
[]
no_license
import React from 'react'; import PropTypes from 'prop-types'; const Clima = ({ resultado }) => { //Extraer Valores const {main, name} = resultado; if(!main) return null; const temperatura = parseFloat(main.temp - 273.15, 10).toFixed(2); const temperaturaMax = parseFloat(main.temp_max - 273.15, 10).toF...
true
ad4bbc9f9ed1c114f1f650720a05c3adf22e3345
JavaScript
last-endcode/JavaScript-Basics
/30_globalscope.js
UTF-8
718
4.375
4
[]
no_license
// Global scope vs Local variable // any variable outside code block{} // is said to be in GLOBAL scope // can be access anywhere in the program let name = 'john doe'; function localFunction() { console.log(`${name} in function`); name = 'peter function'; //inner function inner() { console.log(`here insid...
true
d63036930d17c59b99d7f11dd7f2b7bedbbc6981
JavaScript
mogiihu/mobileScript
/giveWater.js
UTF-8
1,416
2.625
3
[]
no_license
let zhidubaoIcon = desc('支付宝').findOne(); zhidubaoIcon.click(); sleep(200); let gengduoText = text('更多').findOne(); let gengduoIcon = gengduoText.parent(); gengduoIcon.click(); sleep(200); let mayisenlinText = text('蚂蚁森林').findOne(); let mayisenlinIcon = mayisenlinText.parent().parent(); mayisenlinIcon.click(); let...
true