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
c0c5fd05d466baa9e092b14f01337480a54e482d
JavaScript
IvanKryuchkov/number-vote
/src/components/Main.js
UTF-8
2,805
2.703125
3
[]
no_license
import React, { useState, useEffect } from 'react'; import { PieChart } from 'react-minimal-pie-chart'; import Vote from './Vote'; import Modal from 'react-modal'; import './Main.css'; const Main = () => { const [modalIsOpen,setIsOpen] = useState(false); function openModal() { setIsOpen(true); } ...
true
4e459b9eff52d3d6605ed91d5358caffd7958066
JavaScript
micromark/micromark
/packages/micromark-core-commonmark/dev/lib/attention.js
UTF-8
8,497
2.5625
3
[ "MIT" ]
permissive
/** * @typedef {import('micromark-util-types').Code} Code * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Event} Event * @typedef {import('micromark-util-types').Point} Point * @typedef {import('micromark-util-types').Resolver} Resolver * @typedef {import...
true
b4cbc99dce59313d4b5d4d97d18fcefe03d49ac1
JavaScript
kimmaga/nodeSp
/nodeSp/app.js
UTF-8
48,447
3.609375
4
[]
no_license
// Application // Request // Response // Routing // Application const express = require('express'); //불러온 익스프레스 객체에는 하나의 함수가 할당되는데 그 함수를 실행하면 익스프레스 객체가 생성됩니다. const app = express(); //익스프레스 클래스를 이용해 익스프레스 객체를 만든다고 생각하면 됩니다. 이것을 익스프레스 어플리케이션(Application)이라고 하는데 우리 코드에서는 app 상수에 할당했습니다. //익스프레스 인스턴스 (app) 가...
true
022dc9b20059b56561086b2e6d62e07fba0da709
JavaScript
frnsys/phospho
/static/js/main.js
UTF-8
7,599
2.609375
3
[]
no_license
import Scene from './scene.js'; import GLTFLoader from './gltf.js'; const OBJ_MASS = 10; const MOUSE_VEL_SCALE = 3000; const SPHERE_POS = {x: 0, y: 0, z: -10}; const SPHERE_RAD = 2; const loader = new GLTFLoader(); function makeWall(pos, rot) { let body = new CANNON.Body({ mass: 0, // mass == 0 makes the body...
true
6debb519034d6cbda3a3704794324c83b865ce0e
JavaScript
hadiburpee/hamazon
/hamazonCust.js
UTF-8
3,201
3.03125
3
[]
no_license
var mysql = require("mysql"); var inquirer = require("inquirer"); var Table = require("cli-table"); var productDisp = false; var table = new Table({ head: ["Prod No.", "Product", "Department", "Price" , "Quantity"], colWidths: [10, 20, 20, 20, 10] }); var connection = mysql.createConnection({ host: "local...
true
60cc36b72ce43485cbda800d1bbdc1551795b17a
JavaScript
juanjcxp/22ejercicios-javascript
/8.js
UTF-8
611
4.25
4
[]
no_license
// (8) ---------------------------------------------------------------------- // Cree una función que tome una matriz de matrices con números. // Devuelve una nueva matriz (única) con el mayor número de cada uno. // findLargestNums([[4, 2, 7, 1], [20, 70, 40, 90], [1, 2, 0]]) ➞ [7, 90, 2] // --------------------------...
true
77247fd24f66f6f0b56ae96ab33689776d34992b
JavaScript
grubern/eslint-plugin-jsx-a11y
/src/util/hasAttribute.js
UTF-8
1,055
3.109375
3
[ "MIT" ]
permissive
'use strict'; import getAttributeValue from './getAttributeValue'; /** * Returns the value of the attribute or false, indicating the attribute * is not present on the JSX opening element. This skips over spread attributes * as the purpose of this linter is to do hard checks of explicit JSX props. * * This treats...
true
d394f01a1e5eae29b79e134a6bf1e6ff239d13e2
JavaScript
softdevelop/Kapua-Engineering
/sortable-tree/src/component/Tree.js
UTF-8
3,707
2.59375
3
[ "MIT" ]
permissive
import 'react-sortable-tree/style.css'; import React, { Component } from 'react'; import SortableTree, { getFlatDataFromTree } from 'react-sortable-tree'; import { APIURL } from '../constants/Constants'; import axios from 'axios'; export default class Tree extends Component { constructor(props) { super(props); ...
true
3078f32f0d2836cf487dddac381458cdb7823a3e
JavaScript
fuermiguel/TiendaMusicaDEW
/js/tienda_prueba.js
UTF-8
768
2.640625
3
[]
no_license
let Tienda = require('./Tienda'); let tienda = new Tienda(); tienda.addDisco({ titulo: 'titulo1', cantante: 'cantante1', tipo: 'tipo1', fecha: 1, estanteria: 10, prestado: false }); tienda.addDisco({ titulo: 'titulo2', cantante: 'cantante2', tipo: 'tipo2', fecha: 2, estanteria: 11, prestado: true }); tienda.addDisco(...
true
fba5c29011221748cc189e86dac04f75ba06f6f7
JavaScript
kevinakahoshi/leetcode-problems
/easy/202/solution.js
UTF-8
398
3.34375
3
[]
no_license
// @param {number} n // @return {boolean} const isHappy = n => { let prevN = []; while (!prevN.includes(n)) { prevN.push(n); const splitNum = n.toString().split(''); splitNum.forEach((element, index) => { splitNum[index] = Math.pow(parseInt(element), 2); }); n = splitNum.reduce((accum, cu...
true
93b24033a10e3b43113ce9e770e83442a01af9f9
JavaScript
glennj/exercism.io
/javascript/complex-numbers/complex-numbers.js
UTF-8
1,642
3.296875
3
[ "MIT" ]
permissive
/* eslint-disable no-multi-spaces, indent */ /* eslint no-underscore-dangle: ["error", { "allowAfterThis": true }] */ export class ComplexNumber { constructor(a, b) { this.real = a; this.imag = b; } add(other) { if (!(other instanceof ComplexNumber)) throw new Error(); return new ComplexNumber(...
true
ee357d24b0134430a38ce8b1509d7c1ce4218e47
JavaScript
mdjolieca/findYourHat
/main.js
UTF-8
2,950
3.640625
4
[]
no_license
const prompt = require('prompt-sync')({sigint: true}); const hat = '^'; const hole = 'O'; const fieldCharacter = '░'; const pathCharacter = '*'; class Field { constructor(field,){ this.field = field; this.fieldHeight = field.length; this.fieldWidth = field[0].length; this.userPostion = { height: 0...
true
cee97a47aed4cf453d52c3a712c9166dff6aa985
JavaScript
iranefedova/node-nw-4
/additional.js
UTF-8
1,353
3
3
[]
no_license
"use strict"; const Readable = require("stream").Readable; const Writable = require("stream").Writable; const Transform = require("stream").Transform; const HIGH_WATER_MARK = 1; function getRandomInRange(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } class RandReadable extends Readable...
true
70d36c28eb5c1cf97368419b695295f6142c801d
JavaScript
asifmohd94/superHero
/js/index.js
UTF-8
1,895
3.265625
3
[]
no_license
const charactersList = document.getElementById('charactersList'); let hpCharacters = {}; let results = []; let favoritesArray = JSON.parse(localStorage.getItem("favoritesArray")); let specificChar = {}; const addToFavorites = (id) => { favoritesArray.push(id); alert("added to favorites"); localSto...
true
943ce6c015939f0b2bb55ad15b4e73b7cb30b298
JavaScript
sandipgole/Javascript
/part-1/Objects.js
UTF-8
639
2.921875
3
[]
no_license
var person={ name:"ram", age:40, country:"Nepal", address:{ city:"ktm", homeNumber:7 } }; /*console.log(JSON.stringify(person)); // console.log(person.name); // console.log(person.age); console.log(Object.values(person));*/ var student={ name:"sandip", age:19, address:...
true
85c06fcd1a101a02f04c817e70d443ebc7d77656
JavaScript
mehul1802/Food-delivery-app
/src/reducers/dialog-reducer.js
UTF-8
403
2.546875
3
[]
no_license
import * as dialogTypes from '../types/dialog' const initialState = { showSignIn: false }; export function dialog(state = initialState, action) { switch (action.type) { case dialogTypes.SHOW_LOGIN: return { ...state, showSignIn: true }; case dialogTypes.HIDE_LOGIN: return {...
true
d083aa0b6b70c84f8ed9ba0ff496e4e3a4433ca7
JavaScript
zpalexander/podcaster
/public/actions/addFeed.js
UTF-8
1,675
2.609375
3
[]
no_license
/** * addFeed.js * * Actions related to the AddFeed view */ /* Dependencies */ import fetch from 'isomorphic-fetch'; // Constants import * as types from '../constants/ActionTypes'; // Actions import { fetchFeeds } from './feeds'; /* Actions */ export function handleAddFeedInput(field, text) { return { ...
true
fc4f66998e258af7e8e080a5c24b08a7770f7cc4
JavaScript
zoldello/rosalind-AureliaJS
/src/util/rNA.js
UTF-8
1,553
2.796875
3
[ "MIT" ]
permissive
/// Bioinformatics Library ///TODO: (1)If this becomes larges, refactor into an extension to _ /// (2) This is intended to have no dependencies (function () { var root = this; var _ = !_ ? {} : _; _.bioinformatics = !_.bioinformatics ? {} : _.bioinformatics; _.bioinformatics.RNA = !_.bioinformatics.RNA ? {} ...
true
ea656df869c949ad2feb67c8d7273c7a115064bd
JavaScript
Vaxe1066/TicTacToe
/script.js
UTF-8
5,310
3.1875
3
[]
no_license
//let array = [["x","o","x"],["x","x","o"], ["o","x","o"]] /* below is the module to display the grid contents to the grid */ const displayController = ( function(array) { const _idxArray = (i,j) =>{ let idx = `${i+1}${j+1}`; const boxId = document.querySelector("#box_" + idx ) if(boxId...
true
a39f8ce26be45f657e00cfa72420b57519f84f2a
JavaScript
ispzz/sei40-homework
/reece_nimorakiotakis/week2/day 4/dom-intro/main.js
UTF-8
685
3.3125
3
[]
no_license
// document.querySelector('body').style.fontFamily="Arial, sans-serif"; // document.querySelector('#nickname').innerHTML="Reece"; // document.querySelector('#favorites').innerHTML="Food"; // document.querySelector('#hometown').innerHTML="Melbourne"; console.log('About Me'); // document.body.style.fontFamily('Arial, s...
true
3470f8354bb8d50f4d6a737d5317f767f782de0b
JavaScript
AdrianQuezada/gif
/app.js
UTF-8
2,094
2.78125
3
[]
no_license
var api= "https://api.giphy.com/v1/gifs/search?"; var apiKey= "api_key=04noUiG0MaUOXsL6vBbo1QK39BLQwfTU"; var availableCars = [ 'BMW', 'Acura', 'Ford', 'Honda', 'Lexus', 'Dodger', 'Toyota', 'Chevrolet', 'Nissan', 'Fantam', 'Ram', 'Subaru', 'Maserati', 'Jeep', ...
true
776ab50bd3bb8761ecc2b6d8159479716ee401ab
JavaScript
AlessandraMitie/alura_gamedev
/scripts/jogo/personagem.js
UTF-8
2,291
3.234375
3
[]
no_license
class Personagem extends Animacao{ constructor(matriz, imagem, x, variacaoY, largura, altura, larguraSprite, alturaSprite) { super(matriz, imagem, x, variacaoY, largura, altura, larguraSprite, alturaSprite); // this.frameAtual = 0; //qual a posição/o array da matriz this.variacaoY = variacaoY...
true
476b5b2c7c51358d49a4a6d6a0a57f561999590b
JavaScript
AleksCrash/GameEngine-Platformer
/app/assets/js/app.js
UTF-8
647
3.234375
3
[]
no_license
import '../css/app.css'; // main class Game class Game { constructor() { this.body = document.getElementById('body'); this.canvas = document.getElementById('canvas'); this.canvas.width = window.innerWidth; this.canvas.height = window.innerHeight; this.ctx = this.canvas.getContext('2d'); this...
true
78b3d772a6e06bf0edb4c1cb44943aaa32081a40
JavaScript
keremersan01/Ozyegin-University
/CS391/2020-2021/Spring/Week07-CodeSamplesForMidterm/assets/js/myfunctions.js
UTF-8
981
3.671875
4
[]
no_license
function validateForm(){ var number1=document.getElementById("number1").value; var number2=document.getElementById("number2").value; if(number1==null||number1==""){ alert("Enter first number, please!") return false; } calculate(); return true; } function calculate(){ var nu...
true
e7ebc3a1383094d4b0b6ea2a36257e56a4e0a6ae
JavaScript
JoshApstein/yours-channels
/lib/msgs/msg-update.js
UTF-8
1,145
2.609375
3
[]
no_license
/** * MsgUpdate * ========= * * Message to update the commitment transaction. When an agent wishes to make a * payment or to update the commitment transaction for any other reason, such * as reducing the output list or changing the fee amount, they send an * 'update' message. When an agent sends an update messa...
true
51d6ae742d376e11aa5260356b5794d16983f5d1
JavaScript
sandhawke/psdad.js
/manual-match.js
UTF-8
3,876
2.75
3
[]
no_license
const debug = require('debug')(__filename.split('/').slice(-1).join()) /* Equivalent to merging the templates into a regexp and doing exec, but in steps we control, so that we can report why the match is failing to happen, and otherwise check that the regex is behaving as we expect. */ // this emulates the wo...
true
7a0e9b4703b5de856b569e80bceb36c86d982e71
JavaScript
joshuataylor514/jslesson5
/main.js
UTF-8
588
3.546875
4
[]
no_license
Variable var name = "Joshua"; Alert alert("Welcome to NYCDA!"); Data Types String - "Cats"; Number - "54"; Boolean - "True, False"; Arrays ["Dasher", "Dancer", "Prancer", "Vixen"]; Testing "zebras" === "mules"; >false 8 >10; >false Testing Operators: <, >, <=, >=, ===, !==; Logic & Functions var speedLimi...
true
454797bd7982abb8aef4467ed2a8e953ef54ff40
JavaScript
niuzhiyong2016-11/201611node
/14.es6/3.tmpl.js
UTF-8
638
3.578125
4
[ "MIT" ]
permissive
let name = 'zfpx'; let age = 8; //let desc = name+' is '+age +'岁了'; /*let desc = "${name} is ${age} 岁了"; function tmpl(tmplStr){ return tmplStr.replace(/\$\{(\w+)\}/g,function(){ return eval(arguments[1]); }); } console.log(tmpl(desc)); */ //其余参数 function change(strings,...values){ //let other = Array.pr...
true
be7d86ee36da17829d5707f96cf7359be030d04e
JavaScript
swc-project/swc
/crates/swc/tests/tsc-references/typeFromJSInitializer4.1.normal.js
UTF-8
601
3.078125
3
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
//// [a.js] /** @type {number | undefined} */ var n; // should get any on parameter initialisers function f() { var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null, b = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : n, l = arguments.length > 2 && arguments[2] !== void 0 ?...
true
6f8623a81df1355461a4998de103e8789ea80aaf
JavaScript
jayeshk-star/Dsa_javascript
/QuestionOnnstring/spiral2.js
UTF-8
1,709
3.03125
3
[]
no_license
function runProgram(input) { input = input.trim().split("\n"); // console.log(input); // console.log(test); var test = +input[0]; var line = 1; for (var i = 0; i < test; i++) { var [row, col] = input[line].trim().split(" ").map(Number); line++; var mat = []; for (var j = 0; j < row; j++) { ...
true
4d58581301f2b7718aba4c4d9f4190190baef95c
JavaScript
aengland94/cit261-portfolio
/js/css_transformations.js
UTF-8
1,889
3.125
3
[]
no_license
var slideContainer, slideShow, slides, slideIndex, width, lastButtonClicked; // var leftBtn = $('#left'); // var rightBtn = $('#right'); // var width = 1140; function init() { slideContainer = document.getElementById("slideContainer"); slideShow = document.getElementById("slideShow"); slides = document.getEl...
true
928e7d4591aaec7de2c02c11cacdc61fa545c4ee
JavaScript
ashab272000/asiaWebsite
/src/Screens/decorateScreen/Canvas/imageloader.js
UTF-8
2,454
3.375
3
[]
no_license
export class ImageLoader{ constructor(canvasWidth, canvasHeight){ this._canvasWidth = canvasWidth; this._canvasHeight = canvasHeight; this._imagePromise = null; } async getImg() { let imageValues = await this._imagePromise; return imageValues.img; } ...
true
b365faa4a0b1d431a35c3357d6d9c832a55c32ca
JavaScript
ThuyNT13/algorithm-practice
/tests/spec/productOfIntsSpec.js
UTF-8
1,157
3.125
3
[ "MIT" ]
permissive
describe('getProductsOfAllIntsExceptAtIndex()', function() { describe('returns an array of products for all integers, except at integer.', function() { it('[0, 0, 90, 0] for [5, 9, 0, 2]', function() { var array = [5, 9, 0, 2]; expect(getProductsOfAllIntsExceptAtIndex(array)).toEqual([0, 0, 90, 0]); ...
true
6f314f89514c358220d209fb19c4e20e5f045154
JavaScript
Car-Hacked/api
/server/socket.io.js
UTF-8
371
2.578125
3
[]
no_license
import { Server } from 'socket.io'; const server = http.createServer().listen(process.env.PORT); const io = new Server(server); io.on('connection', (socket) => { let time = setInterval(() => { let current = new Date().toTimeString(); socket.emit("time", { time: current }); console.log(`Emm...
true
2130a1409e0cb83c5bf2a50aa46dfa83bce62d06
JavaScript
levinhphuc95/Tracking_Learning_FullstackJS
/client/src/redux/Actions/AuthAction.js
UTF-8
2,082
2.515625
3
[]
no_license
import { apiUrl, LOCAL_STORAGE_TOKEN_NAME } from "../../utils/constants"; import setAuthToken from "../../utils/setAuthToken"; import axios from "axios"; // Get info export const loadUserAction = () => { return async (dispatch) => { if (localStorage[LOCAL_STORAGE_TOKEN_NAME]) { setAuthToken(localStorage[LOC...
true
9861ac39ce6aaa2be4317ea949f97d02fcd7dc9e
JavaScript
dwyanecf/BookStore_final
/common_static/js/login.js
UTF-8
589
2.578125
3
[]
no_license
function SignIn(){ var User_id=$("#SignIn_UserName").val(); var Pwd=$("#SignIn_Pwd").val(); console.log(User_id); if(User_id=="" ||Pwd==""){ alert('Please Input user name and password!'); return; } $.ajax({ type:"POST", url:"SignIn/", data:{'User_id':User_id,'Pwd':Pwd}, success:function (result) { v...
true
bba99d623cfab362b1ab120a2f6d085a6312fa6e
JavaScript
Elevationacademy/test-assignment-2-talbronfer
/ex-5.js
UTF-8
520
3.15625
3
[]
no_license
// - DO NOT modify/delete *any* starter code (you can remove the comments though) function Exercise5() { const reservations = { Bob: { claimed: false }, Ted: { claimed: true } } //!IMPORTANT! Uncomment this line to work on this exercise // const name = prompt('Please enter the name for...
true
2b875c106df07b852bf815317d2eda4dd6c04c64
JavaScript
hey-abhi/Redux-Saga-App
/src/reducers/reducer.js
UTF-8
367
2.5625
3
[]
no_license
const initialState = 0; const reducerfunction = (state = initialState, action) => { switch (action.type) { case "INCREMENT_BY_ONE": return state + 1 case "DECREMENT_BY_ONE": return state - 1 case "RESET_COUNT": return 0 default : retu...
true
31e79c994aaa3ef5470a61227319bbecd25694e8
JavaScript
akdlsz21/sketch
/script.js
UTF-8
2,546
3.421875
3
[]
no_license
function getRandomColor() { return Math.floor(Math.random() * 255); } const container = document.querySelector('.container'); const range = document.querySelector('.range'); let val = range.value; let color = false; const textColor = document.querySelector('.color-mode'); // Generates div.grid inside container functio...
true
b42cb99d482cb37042ee50c83386f19c028e6375
JavaScript
andydlindsay/jun21-2021
/w03d01/simple-server.js
UTF-8
581
2.890625
3
[]
no_license
const http = require('http'); const server = http.createServer((request, response) => { // console.log(request); const url = request.url; const method = request.method; // GET /home, POST /users const reqStr = `${method} ${url}`; console.log(reqStr); if (reqStr === 'GET /home') { response.end('you ...
true
c84fd2f176e080a56d1f67358a246ddd8a0a9ab8
JavaScript
jeuk817/codecquad3
/JS공통/Step4/step4-2/step4-2todos.js
UTF-8
4,813
3.328125
3
[]
no_license
const makenewTodoObject = function (todos) { const newTodoObject = { 'todo': [], 'doing': [], 'done': [] }; todos.forEach(function (todo) { const key = todo.status; const value = todo.name; newTodoObject[key].push(value); }) return newTodoObject; }; const printAll = function (...
true
86e1259933424e438db01f4c4b8deef583f06948
JavaScript
UngDevloperBot/dragonbotdev
/commands/battlefield4.js
UTF-8
3,233
2.515625
3
[ "MIT" ]
permissive
const request = require('request-promise-native'); exports.run = async (bot, message, args) => { try { let platform; let username; if(!['pc', 'ps4', 'xone', 'ps3', 'xbox'].includes(args[0])) return message.channel.send(' **Por favor especifique a plataforma:** `d!battlefield4 <plataforma [ pc | xone | ps4 | ps3 | xb...
true
d8db140fdf76d5b2698d1b1391d10e49746e7910
JavaScript
pierlucamariodussich/js-snack-es6
/jsnacks-6/script.js
UTF-8
1,531
3.984375
4
[]
no_license
/* dato questo array di obj iniziale: var arrayObj = [ {name: 'Poppy', type: 'tshirt', color: 'red'}, {name: 'Jumping', type: 'occhiali', color: 'blue'}, {name: 'CrissCross', type: 'scarpe', color: 'black'}, {name: 'Jenny', type: 'borsa', color: 'pink'}, ]; Creiamo una copia dell’array di partenza e aggiungiam...
true
4de3e344b4245a729ad5022347e5b7a72a74f7e4
JavaScript
Ekomma/team-mangement
/models/scheduleModel.js
UTF-8
815
2.5625
3
[]
no_license
const mongoose = require("mongoose"); const scheduleSchema = mongoose.Schema({ team: { type: String, required: true, }, opponent: { type: String, required: true, }, date: { type: String, required: true, }, time: { type: String, required: true, }, status: { type: St...
true
eecdfd71649de3f2b97b3a39c01a363b7c5b0a96
JavaScript
conwabueze/jonahs-place
/backend/public/scripts/updateAccountScript.js
UTF-8
2,932
3.015625
3
[]
no_license
const editForm = document.querySelector('.edit-form'); const name = document.querySelector('#name'); const nameValue = name.value; const email = document.querySelector('#email'); const emailValue = email.value; const editErrorHeader = document.querySelector('.edit-error-header'); const editSuccessHeader = document.quer...
true
889666c2475e45e8229fd0baee5adee2fc00538b
JavaScript
gnoem/dragonfly
/client/src/components/Dropdown/index.js
UTF-8
5,688
2.5625
3
[]
no_license
import "./Dropdown.css"; import { useEffect, useRef, useState } from "react"; import { elementHasParent } from "../../utils"; export const Dropdown = ({ defaultValue, listItems, restoreDefault, onChange, addNew, style }) => { const [display, setDisplay] = useState(() => { if (!listItems || !listItems.lengt...
true
ac309b8f0491f387d5502678455b31bd0c67aec5
JavaScript
DarrylD/dribbbleaway
/helpers.js
UTF-8
16,173
2.578125
3
[]
no_license
/** * to show and remove page overlay and kill scrolling * @param {[string]} condition [on or off] * @param {[obj]} view [view obj passed for closing] * @param {[string]} hide [optional: tell the helper tp hide the view opposed to removing it] * @return {[event]} [show overlay or remove ...
true
75ae70bdfdb66564e44171e2d1922e2361cd4d2b
JavaScript
ultraq/icu-message-formatter
/source/pluralTypeHandler.test.js
UTF-8
5,715
2.640625
3
[ "Apache-2.0" ]
permissive
/* * Copyright 2019, Emanuel Rabina (http://www.ultraq.net.nz/) * * 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 requ...
true
f0eb963409ebb87a28317e35e99e7edeaca75838
JavaScript
Tech-Univ-2020/increment-char
/fib/test.js
UTF-8
443
3.78125
4
[]
no_license
const fib = require('./fib'); console.log('should return an array', Array.isArray(fib(2)) === true); console.log('should return an array of length n', fib(2).length === 2); fib(2).forEach((num) => { console.log(`${num} is a number`, typeof num === "number"); }); console.log('should return an array of n numbers ...
true
adb14b70a6b748de8da5b5762bb416cb8bc36148
JavaScript
BadLice/agar.io
/player.js
UTF-8
1,895
3.390625
3
[]
no_license
class Player { constructor(circle,speed) { this.circle=circle; this.realPosX=0; this.realPosY=0; this.speed=speed; } draw() { this.circle.draw(); } update() { this.move(); this.eat(); } move() { var mx = map(mouseX,0,width,...
true
e7ac270cd58ac84d91dcdabab309516e56aac89b
JavaScript
Nido89/ModernJavascriptpractice
/MusicApp/OxJS/source/UI/js/Core/Clipboard.js
UTF-8
2,277
2.90625
3
[]
no_license
'use strict'; /*@ Ox.Clipboard <o> Basic clipboard handler add <f> Add items to clipboard (items[, type]) -> <n> Number of items clear <f> Clear clipboard () -> <n> Number of items copy <f> Copy items to clipboard (items[, type]) -> <n> Number of items paste <f> Paste items from...
true
bf899fa4bec46d5826040a498a6d8251612f7b0e
JavaScript
vadimstroganov/js-course
/hm9/js/index.js
UTF-8
4,434
2.609375
3
[]
no_license
let friends_nosort = document.getElementById('friends_nosort'); let friends_sort = document.getElementById('friends_sort'); function dragStart(ev) { ev.dataTransfer.effectAllowed='move'; ev.dataTransfer.setData("Text", ev.target.dataset.userId); return true; } function dragEnter(ev) { event.preventDefault()...
true
ebbcbdaecb4d17964467b912eaa997e8fe7dd608
JavaScript
FernandoEspana/roulette
/src/controllers/roulette.controller.js
UTF-8
2,111
2.8125
3
[]
no_license
const Roulette = require('../models/roulette.model'); const { randomNumber, returnColor } = require('../utils/bet-process'); module.exports = { async create(req, res) { const body = { state: false, betIDs: [] }; try { const roulette = await Roulette.create(body); res.status(201).json({ ro...
true
216400160e1feff780cf55970dd6c79c42907f51
JavaScript
abrarc004/week2-b23
/day1.js
UTF-8
4,062
4.46875
4
[]
no_license
// HTML - Hyper Text Markup Language, To create the structure of a website , it defines for example what is a heading, a subheading, a paragraph, a list, image etc... // CSS - Cascading Style Sheet = Define the design of your website, for example my h1 is blue, font size 32 px ... etc // Javascript - What make a websit...
true
a312d8a4164ca50cd3f797bc1061af0a08acbdb3
JavaScript
kosenkovd/lk
/assets/js/banner.js
UTF-8
3,015
2.59375
3
[]
no_license
function getRemainingTime() { var e = Date.now(), n = one - e; dremaining = n, dremaining = dremaining / 1e3 - dremaining % 1e3 / 1e3, dremaining = dremaining / 60 - dremaining % 60 / 60, dremaining = dremaining / 60 - dremaining % 60 / 60, dremaining = dremaining / 24 - dremaining % 24 / 24; var i, a; switch (dr...
true
0dd785e39a77fb526bfdb4495cbc66ffd5681ddb
JavaScript
ProfBMoriarty/Knecht
/BattleShip/KnechtClient0.99.js
UTF-8
35,493
2.984375
3
[]
no_license
var K = {}; (function () { "use strict"; //region Global Variables //values rarely changed during a session, stored so they do not need to be provided explicitly to each function call var _address = 'http://perlenspiel.cs.wpi.edu/'; //the address of the server, with trailing slash var _application...
true
66992ed1d6fd1b71d21a8511e7ceae7e71b80478
JavaScript
Luganda1/Soduku_solver-
/routes/api.js
UTF-8
1,882
3.234375
3
[]
no_license
'use strict'; const SudokuSolver = require('../controllers/sudoku-solver.js'); module.exports = function (app) { let solver = new SudokuSolver(); app.route('/api/check') .post((req, res) => { const {puzzle, coordinate, value} = req.body if(!puzzle || !coordinate || !value){ res...
true
98f5d416e7c52b033eb61f620ece2d5435e26885
JavaScript
LuiArm/project-1
/js/webcomponents.js
UTF-8
1,223
3.125
3
[]
no_license
// USE THIS FILE TO WRITE ANY WEB COMPONENTS, use example for reference ////////////////////////////////// // Web Components Classes Here ////////////////////////////////// class MyCard extends HTMLElement { constructor(){ super() const description= this.getAttribute("description") ...
true
592c8d5bef2eec17ef0d95e1936a4ec1f2883041
JavaScript
LucasVieiraa/StudyFiles
/OBJECTS/Teste3.js
UTF-8
166
2.734375
3
[]
no_license
function Carro(marca, modelo, ano){ this.marca = marca this.modelo = modelo this.ano = ano } const carro1 = new Carro('Charger', 'RT', 1970) console.log(carro1)
true
0037608bccac547f12fe716ae0dea48fd569fb5b
JavaScript
luroto/holbertonschool-higher_level_programming
/0x12-javascript-warm_up/4-concat.js
UTF-8
150
2.796875
3
[]
no_license
#!/usr/bin/node const printing = String(process.argv[2]); const printing1 = String(process.argv[3]); console.log(printing.concat(' is ', printing1));
true
d186f45e0fb2e93ea009d2ae528cfb694e4319e4
JavaScript
Rome1317/Programacion-Web
/Science & Tech/JS/comments.js
UTF-8
1,376
2.703125
3
[]
no_license
var btn = document.getElementById("btnop"); var btn2 = document.getElementById("btnop2"); var closebtn = document.getElementById("close"); var sidebar = document.getElementById("panel"); var text = document.getElementById("text1"); var opt = document.getElementById("opt"); var clear = document.getElementById("btnc"); ...
true
8ad520af41cefed460f018acc5ea85c497462331
JavaScript
marianomastronardi/LaboratorioIII_Clases-3C
/TypeScript/build/funciones.js
UTF-8
8,916
2.65625
3
[]
no_license
"use strict"; var Animales; (function (Animales) { //var listaGato: Array<Gato> = new Array<Gato>(); var auxAnimal = new Array(); var listaAnimal = new Array(); var perro; var razaperro; var gato; var razagato; var pajaro; var razapajaro; var edad; var bmt; var row; v...
true
04511965d6013091952184c7f49ccbfb6f9e1441
JavaScript
lewiscutey/five-in-a-row
/js/index.js
UTF-8
13,051
2.890625
3
[]
no_license
/** * Created by Lewis on 2016/9/29. */ $(function () { var canvas = $('#canvas').get(0); var ctx = canvas.getContext('2d'); var width = canvas.width; var Row = 15; var W = width / Row; var flag = true; var blocks = {}; var blanks = {}; var ai = false; var audio = $("#audio").g...
true
0c3227f86415632066a3069d1a97be9d54609058
JavaScript
gaofan9842/maogai_web
/js/d-login.js
UTF-8
2,164
2.609375
3
[]
no_license
//登录切换元素的父元素 var regTop=document.getElementById('reg-top'); //获取扫码登录元素 var saoma=document.getElementById('qrcode'); //获取PC登录元素 var screen=document.getElementById('screen'); //获取普通登录对应的div var rc=document.getElementById('rc'); var sm=document.getElementById('sm'); //实现登录方式的切换 // saoma.onclick=function(){ // rc.sty...
true
ed6151be9a3196e0f90d324cc22b9b76c0d8d93e
JavaScript
AthoxGit/NitroGenerator-v1.2
/main.js
UTF-8
466
2.671875
3
[]
no_license
console.log('Starting...') const fs = require('fs') let a = 'a' while (a) { let code = ''; let dict = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; for(var i = 0; i < 16; i++){ code = code + dict.charAt(Math.floor(Math.random() * dict.length)); } let toSave = `https://...
true
1350ce7788e38ac868472d87214506bd475ce898
JavaScript
KevinSalvatore/AJie_JS
/5.最长回文子串.js
UTF-8
682
3.734375
4
[]
no_license
/* * @lc app=leetcode.cn id=5 lang=javascript * * [5] 最长回文子串 */ /** * @param {string} s * @return {string} */ var longestPalindrome = function(s) { var isRight = function(s) { let times = Math.floor(s.length / 2); let result = true; for (let i = 0; i < times; i++) { if (s[i] !== s[s.length - ...
true
4a883a13ec1a2fb2c54fa4c0ef873affd5b9aef2
JavaScript
n19015/react-app
/src/App.js
UTF-8
1,195
2.984375
3
[]
no_license
import React from 'react' import './App.css' import fetch from 'node-fetch' import Button from '@material-ui/core/Button' const today = new Date() var ye = today.getFullYear() var mo = ('0' + (today.getMonth() + 1)).slice(-2) var da = ('0' + today.getDate()).slice(-2) var day = ye + '-' + mo + '-' + da export default...
true
b3c5ba52044e01ff77895433acf28575b79cbe68
JavaScript
adrzal/some-animation-onhover
/main.js
UTF-8
1,403
3.203125
3
[]
no_license
const inwentors = [ { name: "albert", year: 1890 }, { name: "mast", year: 1700 }, { name: "bos", year: 2300 }, { name: "maks", year: 1660 }, { name: "ross", year: 1820 }, { name: "ku", ...
true
fcaec34a1bbd011aa47b60bfa1e6f9e56dc6456d
JavaScript
oieioi/blackjack
/src/Dealer.js
UTF-8
956
2.671875
3
[]
no_license
import React, { Component } from 'react'; import Cards from './Cards'; import Blackjack from './lib/Blackjack'; import './Dealer.css' export default class Dealer extends Component { render() { return ( <div className="dealer"> <h3 className="dealer__name">Dealer</h3> <div className="dealer...
true
68e9253954bc628cf25cbd0fe1dea5994b6d6271
JavaScript
yanshan-2015/sleep-meter
/src/js/male-body.js
UTF-8
3,209
2.59375
3
[]
no_license
/** * Created by yanshan on 2017/6/28. * version 3.1.2 */ //全局样式和页面样式依赖引入 import '../less/common.less' import '../less/male-body.less' //模块化编程之button模块、choseObj模块、ageC模块引入 import {Button} from './component/buttonModule' import {choseObj} from './component/singleChoseModule' import {ageC} from './component/numRangeC...
true
c5a94c05710a271f77ff7d7763b9d1ca65eb858e
JavaScript
felixop8/Todos-App_React_Query_and_Mirage.js
/src/identityManager.js
UTF-8
666
2.984375
3
[]
no_license
import { v4 as uuidv4 } from 'uuid'; export default class IntegerIDManager { constructor() { this.ids = new Set() } // Returns a new unused unique identifier. fetch() { let uuid = uuidv4() while (this.ids.has(uuid)) { uuid = uuidv4() } this.ids.add(uuid) ...
true
8fa6151f9244d10e3ed886d81d14f43844072e76
JavaScript
Pablodias147/JavaScript_basic
/exercicios/ex1/modelo/script.js
UTF-8
666
3.3125
3
[ "MIT" ]
permissive
function carregar() { var txt = window.document.getElementById('txt') var photo = window.document.getElementById('imagem') var data = new Date() var hora = data.getHours() txt.innerHTML = `Agora são ${hora} Horas` if(hora >= 0 && hora <= 12) { //bomdia photo.src = "foto-man...
true
f3171166c53efe927c539eb38363b0a2ab3935d9
JavaScript
almamedia/rest-api-testing-starter-kit
/test/testrunner.js
UTF-8
2,073
2.625
3
[]
no_license
// TODO // REST API Tests // MochaJS + Chai + SuperAgent /* * Require modules * ----------------------------------------------------------------------------- */ var fs = require('fs'); var path = require('path'); var should = require('chai').should(); var request = require('supertest'); va...
true
9c67e1a1df3d931824c69d88e02fbd01bffa0f60
JavaScript
YSeredich/79346-pixel-hunter
/js/templates/components/lives.js
UTF-8
683
2.703125
3
[]
no_license
/** * Created by yulia on 27.11.2016. */ import AbstractView from '../../abstractView'; export default class LivesView extends AbstractView { getMarkup() { const fullElement = '<img src="img/heart__full.svg" class="game__heart" alt="Life" width="32" height="32">'; const emptyElement = '<img src="img/heart__...
true
658c1decd171b4da749cd1415be7b152143a5d5a
JavaScript
aleguzman5/Projects
/DVDLibrarySpringMVC/src/main/webapp/js/DvdList.js
UTF-8
1,547
2.515625
3
[ "MIT" ]
permissive
$(document).ready(function () { $('#search-button').click(function (event) { var newContentRows = $('#newContentRows'); $.ajax({ type: 'GET', url: 'search/dvds/', success: function (data, status) { $.each(data, function (index, dvd) { ...
true
0ad783c31fefbee30c4c38bf3351e56f0922ee99
JavaScript
amigosdobart/gpp
/WPP/scripts/scripts_null_senha.js
ISO-8859-1
1,512
3.359375
3
[]
no_license
function Trim(sEntrada) { sString = new String(sEntrada) for ( var iCount2 = 0; iCount2 < sString.length ; iCount2++ ) if ( sString.charAt(iCount2) != " ") break; for ( var iCount = sString.length - 1; iCount > 0 ; iCount-- ) if ( sString.charAt(iCount) != " ") break; if ( iCount2 > iCount ) return "...
true
25d54fac54aaa1881ac99de7976ea6172fb6a219
JavaScript
sayantanHack/JS-from-Basics
/02Advance/newClass.js
UTF-8
735
4.09375
4
[]
no_license
// 1st letter of any class should be Uppercase (not compulsarry) class User { constructor(firstname,lastname, credit) { this.first = firstname this.last = lastname this.credit = credit } // new method user defined // inside of the Class we no need to write the function keyword before the function name...
true
cb3e14a38dd0a725c174cee550fb4dbb4485c1ce
JavaScript
kaysonyang/bms
/react/src/components/ui/DataTable/DataTableBody.jsx
UTF-8
3,470
2.578125
3
[ "MIT" ]
permissive
import React, {PropTypes} from 'react'; import { Table, TableBody, TableFooter, TableHeader, TableHeaderColumn, TableRow, TableRowColumn } from 'material-ui/Table'; class DataTableBody extends React.Component { static propTypes = { data: PropTypes.array.isRequired, column: PropTypes.object.isR...
true
0615d7813e980e680cdd1958372a15239c37f993
JavaScript
ovikosta/KvmPasswordChanger
/kvmcp/static/kvmcp/js/popover.js
UTF-8
842
2.5625
3
[]
no_license
$(document).ready(function () { $('a[data-toggle=popover]').popover({ trigger: 'hover', placement: 'bottom', content: function () { end = $(this).attr('content'); var t = timer(end); if (end <= Date.now()) { clearInterval(si); ...
true
b0fdcd3eaef55d7c6620293c7e51299fa3b6367a
JavaScript
Derevishko/JSCourses
/HomeWork_3/main2.js
UTF-8
3,899
3.046875
3
[]
no_license
var buh={ worker: [], printt: function () { this.worker.forEach(function (e){ e.ptint(e.name,e.age,e.dep,e.gold,e.exp); }) }, pusOrKill: function(q){ if(typeof(q)=="object"){ this.worker.push(q); }; if(typeof(q)=="string"){ this.worker=this.worker.filter(function(e){ re...
true
d3d0435c3c25476d6517bde91234727b1da83738
JavaScript
yangfeng-gh/es6-demo
/examples/Array/find.js
UTF-8
997
4.3125
4
[]
no_license
/** * 数组实例的find方法,用于找出第一个符合条件的数组成员。 * 它的参数是一个回调函数,所有数组成员依次执行该回调函数,直到找出第一个返回值为true的成员,然后返回该成员。 * 如果没有符合条件的成员,则返回undefined。 */ var e = [1, 4, -5, -10].find((n) => n < 0); //返回的是数组的成员,如果有多个数组成员在回调函数中返回true,仅返回第一个返回true的数组成员 console.log(`find返回的是第一个符合条件的数组成员: ${e}`); var e2= [1, 5, 10, 15].findIndex(function(value, i...
true
051f0589af4c48c5493d7fab104122a83bc9116d
JavaScript
mxaxaxbx/calculator
/ej3.js
UTF-8
2,164
3.96875
4
[]
no_license
// letras y numeros input const letras = document.getElementById("letras"); const numeros = document.getElementById("numeros"); // botones const a1 = document.getElementById("a1"); const b2 = document.getElementById("b2"); const c3 = document.getElementById("c3"); const d4 = document.getElementById("d4"); const e5 = ...
true
49c18731f762f0a5b67e4cfac64d1f3b000d2593
JavaScript
ImJiHwan1/React-MongoDB-Shop
/client/src/components/views/UploadProductPage/UploadProductPage.js
UTF-8
3,737
2.5625
3
[]
no_license
import React, { useState } from 'react' import { Button, Form, Input, message, Typography } from 'antd' import FileUpload from '../../utils/FileUpload' import Axios from 'axios'; const { Title } = Typography const { TextArea } = Input; const Continents = [ {key: 1, value: "Africa"}, {key: 2, value: "Europe"...
true
18751d73d136a9529b2618b9cecc6ea14e42095a
JavaScript
WillemvdVelden/dataprocessing
/Homework/week_3/barchart.js
UTF-8
2,356
3.125
3
[]
no_license
/** * Willem van der Velden * Minor Programmeren Fall 2017 * Data Processing * Week 3 * barchart.js */ var margin = {top: 40, right: 30, bottom: 30, left: 40}, width = 1000 - margin.left - margin.right, height = 500 - margin.top - margin.bottom; var x = d3.scale.ordinal() .rangeRoundBands([0, width], .1); ...
true
01da6a886e037b34762168c5cc10e4c5b2ea0140
JavaScript
benbowes/redux-saga-api-example
/app/reducers/imageSearch.js
UTF-8
1,851
2.59375
3
[]
no_license
import { REQUEST_SEARCH_DATA, RECEIVE_SEARCH_DATA, RECEIVE_SEARCH_DATA_FAILED, REQUEST_SHOW_MORE } from '../constants/actionTypes'; export const initialState = { images: [], isLoading: false, showMorePossible: true, searchTerm: undefined, searchOffset: 0, totalResultsCount: undefined }; export con...
true
300356dc8a81dff7f1d4a49b3abd2f33618b4a92
JavaScript
NuriaCeballos/pr-cticas-con-mongodb-y-mongoose
/dao/daoUser.js
UTF-8
1,622
2.890625
3
[]
no_license
const User = require('../models/User') const daoUser = {} daoUser.guardar = function save(user) { return new Promise((resolved,reject) => { let u = new User(user) u.save() resolved(u) }) } //se encarga de buscar usuarios findOne busca el user //que tiene ese email daoUser.getUserByEmail = function ge...
true
83ff1b09d0f0b759ab06e9cab2acfe2fffdced0e
JavaScript
amos-kibet/zeraki-interview-assessment
/src/Tasks/ReverseString.js
UTF-8
1,248
4.8125
5
[]
no_license
"use strict"; /** * Given a string S of length N, write a function that * transforms the string by reversing characters in groups * of four, and returns the transformed string e.g. * when S = "Lorem at" the output should be "eroLta m" * when S = "Tempor ip" the output should be "meT roppi" * */ function revers...
true
ca5d9050cb7b44cb86e49147b7c75b6c83f0867f
JavaScript
architb1703/SOC_Assign2
/Q2/js_1.js
UTF-8
428
2.65625
3
[]
no_license
function filter_func(){ var comp = document.getElementById("filter").value; var data = document.getElementsByClassName("data_elmt"); for (var i=0; i<data.length; i++){ if(String(data[i].getElementsByTagName("td")[0].innerHTML).toLowerCase().indexOf(comp.toLowerCase())==-1){ data[i].style...
true
18c284284c872faee288693e7135657c1690f27f
JavaScript
AJ-Whalley/attendance
/meteor-app/imports/helpers/dates.js
UTF-8
262
2.671875
3
[ "MIT" ]
permissive
import moment from 'moment' export function humaniseDate(lastIn) { const then = moment(lastIn) const now = moment(new Date()) const hours = Math.floor(moment.duration(now.diff(then)).as('minutes')) return moment.duration(hours, 'minutes').humanize() }
true
57545702ceb29adc8a0509b1fc2cb3cb83088e0d
JavaScript
ko-tori/nso
/lib/Math2.js
UTF-8
4,181
2.828125
3
[]
no_license
var Editor = Editor || {}; var array_values = function (array) { var out = []; for (var key in array) out.push(array[key]); return out; }; class Math2 { static Cpn(p, n) { var out; if (p < 0 || p > n) return 0; p = Math.min(p, n - p); out = 1; for (var i = 1; i < p + 1; i += 1) out...
true
ce04542606d7e09d994c7739a63e1b8c910128a5
JavaScript
green-fox-academy/TarNikolett
/Week18/reddit-project/src/Conponents/AddPost/addPost.js
UTF-8
2,053
2.65625
3
[]
no_license
import React, { useState } from 'react'; import { Redirect } from 'react-router-dom'; import db from '../../Firebase/db'; import './addPost.css'; export default function AddPost() { let [isClicked, setIsClicked] = useState(false); let [formValues, setFormValues] = useState({ title: '', url: '', }); ...
true
b29708096bdeaefbd974253f311454ee405b7fec
JavaScript
Luczko/JavaScript_Homework_JS201920_SEM2
/lab_02_01/excersice_01_03.js
UTF-8
368
4.96875
5
[]
no_license
// 3) Write a function that rotates a list by k elements. For example [1,2,3,4,5,6] rotated by two becomes [3,4,5,6,1,2]. // Try solving this without creating a copy of the list. let numbers = [1, 2, 3, 4, 5, 6]; function rotator(k) { for (let i = 0; i < k; i++) { numbers.push(numbers[0]); numbers.splice(0,...
true
bab4a76f65ee5ff7c0f432744a1ad2ce50202eea
JavaScript
atfienberg/sipmometer
/static/grid.js
UTF-8
455
2.546875
3
[]
no_license
$(function() { var socket = io.connect('http://' + document.domain + ':' + location.port); socket.on('sipm temp', function(msg) { $('#sipm'.concat(msg.num)).text(msg.temp + '°'); }); var newperiodbox = $('#newperiod'); newperiodbox.keydown(function(e) { if (e.which == 13) { ...
true
eceb70b607933218cae5684ea74df8c71013c572
JavaScript
punpun98/CS3305_Project-1
/Client/Game/MainMenu.js
UTF-8
2,724
3.53125
4
[]
no_license
/* * Creates a menu in which a user can enter the game,change settings,learn how to play or see the Credits * */ var words; var MainMenuPointer; function startmainmenu(){ //starts the main menu and sets variables window.addEventListener("keydown",mainmenucontrols); words = ["Create Lobby","Join Lobby","...
true
859ca6a8be98e0c03f4961a6e4718dcb6ecf339b
JavaScript
WarrenMfg/data-dashboard
/client/src/components/BubbleForm.jsx
UTF-8
6,060
2.828125
3
[]
no_license
import React from "react"; class BubbleForm extends React.Component { constructor(props) { super(props); this.state = { title: '', bubbles: [{ setName: '', data: [{ x: '', y: '', r: '' }] }] }; this.handleChange = this.handleChange.bind(this); this.addMoreData ...
true
57f127a69bf688ce2146e8283a5b9ab784222aea
JavaScript
BarsadeJesus/Intro-React
/src/components/pokemon.js
UTF-8
940
2.9375
3
[]
no_license
import React, { useState } from 'react' const Pokemon = () =>{ const [value, setValue] = useState('') const [pokemonImg, setPokemonImg] = useState('') const [pokemonName, setPokemonName] = useState('') const changeValue =(e)=>{ setValue(e.target.value) } const addPokemon = (...
true
7226e9dedaa75131f338c9fd07a09515fcc69160
JavaScript
adhityardt/h8-p0-w3
/exercise-5.js
UTF-8
384
3.625
4
[]
no_license
function palindrome(kata) { let huruf = kata.length - 1; let startPertama = 0; let batasPertama = Math.floor(kata.length/2); let hasil; while (startPertama < batasPertama) { if (kata[startPertama] == kata[huruf]){ hasil = true; } else { hasil = false; } startPertama++; huruf--;...
true
83fa34f6aa6fdf119e47b6763e965cab7af8ca6f
JavaScript
Enalmada/next-preload-headers
/index.js
UTF-8
1,328
2.6875
3
[]
no_license
/* eslint no-cond-assign: 0 */ const interceptor = require("express-interceptor"); function linkFile(name) { // All the nextjs stuff is simple. This would need to get more complex if we wanted to do more than // next static (endings may not be just js or css) let as = "script"; if (name.endsWith(".css")) { ...
true
6e7c8063ef1b13ec03f75f88b9fff8401507e3a7
JavaScript
trevorjdobson/02-tools-and-context
/lab-trevor/test/fp.test.js
UTF-8
1,787
3.453125
3
[]
no_license
"use strict"; const functional = require('../lib/fp.js').Functional // describe("sum tests", () => { // it("it should return 0 for an empty arrary", () => { // expect(77).toBe(77); // }) // }) describe("testing functions", () => { describe("testing the for each function", () ...
true
6e4e2ba882d9137b301820624685964348f11ff7
JavaScript
Fomi4/functions
/main3.js
UTF-8
582
4.78125
5
[]
no_license
// Write a function squareNums which takes an array of elements and returns it but with every element squared. // Example: // squareNums([1, 2, 3, 4, 5]) -> [1, 4, 9, 16, 25] // squareNums([8, 9, 4, 2]) -> [64, 81, 16, 4] function squareNums(nums) { let squares = []; for (let i = 0; i < nums.length; i++) { squ...
true