Skip to content

Commit 2dc3397

Browse files
committed
some const
1 parent e4d0c9b commit 2dc3397

27 files changed

+52
-52
lines changed

src/2015/day11.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
let abc = "abcdefghijklmnopqrstuvwxyz";
2-
let subStrings = abc
1+
const abc = "abcdefghijklmnopqrstuvwxyz";
2+
const subStrings = abc
33
.split("")
44
.map((x, i) => abc.substr(i, 3))
55
.filter(x => x.length === 3);

src/2015/day13.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function longest(graph, curr, visited) {
88
}
99

1010
function parse(input) {
11-
let signs = { gain: +1, lose: -1 };
11+
const signs = { gain: +1, lose: -1 };
1212
let graph = input
1313
.split("\n")
1414
.map(x =>

src/2015/day16.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
let expect1 = {
1+
const expect1 = {
22
id: () => true,
33
children: 3,
44
cats: 7,
@@ -12,7 +12,7 @@ let expect1 = {
1212
perfumes: 1,
1313
};
1414

15-
let expect2 = {
15+
const expect2 = {
1616
...expect1,
1717
cats: x => x > expect1.cats,
1818
trees: x => x > expect1.trees,

src/2015/day21.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function calcOptions() {
2-
let items = {
2+
const items = {
33
weapons: [
44
{ name: "dagger", cost: 8, damage: 4, armor: 0 },
55
{ name: "shortsword", cost: 10, damage: 5, armor: 0 },

src/2015/day22.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
let spells = {
1+
const spells = {
22
Missile: {
33
mana: 53,
44
effect: game => {

src/2015/day23.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
let operations = {
1+
const operations = {
22
hlf: (state, p1) => ({ ...state, [p1]: state[p1] / 2, next: state.next + 1 }),
33
tpl: (state, p1) => ({ ...state, [p1]: state[p1] * 3, next: state.next + 1 }),
44
inc: (state, p1) => ({ ...state, [p1]: state[p1] + 1, next: state.next + 1 }),

src/2016/day01.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
let directions = [
1+
const directions = [
22
{ y: 1, x: 0 },
33
{ y: 0, x: 1 },
44
{ y: -1, x: 0 },

src/2016/day02.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
let directions = {
1+
const directions = {
22
D: { y: 1, x: 0 },
33
R: { y: 0, x: 1 },
44
U: { y: -1, x: 0 },
@@ -28,7 +28,7 @@ function solve(input, keypad, start) {
2828
.join("");
2929
}
3030

31-
let keypad1 = [
31+
const keypad1 = [
3232
["1", "2", "3"],
3333
["4", "5", "6"],
3434
["7", "8", "9"],
@@ -38,7 +38,7 @@ export function part1(input) {
3838
return solve(input, keypad1, { x: 1, y: 1 });
3939
}
4040

41-
let keypad2 = [
41+
const keypad2 = [
4242
[NaN, NaN, "1", NaN, NaN],
4343
[NaN, "2", "3", "4", NaN],
4444
["5", "6", "7", "8", "9"],

src/2016/day12.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
let ops = {
1+
const ops = {
22
cpy: (src, register) => state =>
33
(state[register] = src.match(/^\d+$/) ? +src : state[src]),
44
inc: register => state => state[register]++,

src/2016/day20.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
let MAX_IP = 4294967295;
1+
const MAX_IP = 4294967295;
22

33
function merge(ranges) {
44
ranges.sort((a, b) => a[0] - b[0]);

0 commit comments

Comments
 (0)