Skip to content
Snippets Groups Projects
Commit 96c7b7ca authored by Lillian Gray's avatar Lillian Gray
Browse files

Replace parseInts() with mapping #9

parent 7370f09a
Branches
No related merge requests found
......@@ -269,7 +269,7 @@ function parsePermalink(){
var argsArray = args.split("+")
var startTemp = parseDate(argsArray[0])
var endTemp = parseDate(argsArray[1])
var whichArgs = parseInts(argsArray[2].split(""))
var whichArgs = argsArray[2].split("").map(x => parseInt(x))
for(i=0; i<buildings.length; i++){
if(whichArgs.includes(i)){
buildings[i].enabled = false
......@@ -292,14 +292,6 @@ function parseDate(urlArg){
return new Date(parseInt(dateArr[0]), parseInt(dateArr[1]) - 1, parseInt(dateArr[2]))
}
//takes the string of integers from a permalink and returns them as an array of integers
function parseInts(strArray){
var a = new Array()
for(i=0; i<strArray.length; i++)
a.push(parseInt(strArray[i]))
return a
}
//generates a permalink and copies it, called in index.html when the Get Permalink button is clicked
function genPermalink(){
//month is zero-indexed
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment