x.password.reduce((acc,inc)=>inc==x.letter?acc+1:acc,0)// how times letter appears in password
)(x.low)(x.high)
// Number -> Number -> Number -> Bool
betweenInclusive=x=>low=>high=>x<=high&&x>=low
// String -> Record{String letter, Number low, Number high, String[] password}
parseRecord=x=>{
return{
letter:x.match(matchLetterFollowedByColon)[0],
low:+x.match(matchNumbers)[0],
high:+x.match(matchNumbers)[1],
password:x.match(matchPassword)[0].split("")
}
}
matchPassword=/(?<=: ).*/
matchNumbers=/\d+/gi
matchLetterFollowedByColon=/.(?=:)/
// String -> String[]
returnDelimToArray=x=>x.split("\n")
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.