Skip to content

Commit

Permalink
Update test to use String.prototype.substring() over .substr()
Browse files Browse the repository at this point in the history
 * `String.prototype.substr()` was deprecated, so the test is
      updated to use `String.prototype.substring()` instead
  • Loading branch information
Ak5cel committed Feb 4, 2024
1 parent 57c3a1a commit 1d1dc8f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions exercises/practice/robot-name/robot-name.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Robot } from './robot-name'

const areSequential = (name1: string, name2: string): boolean => {
const alpha1 = name1.substr(0, 2)
const alpha2 = name2.substr(0, 2)
const num1 = Number(name1.substr(2, 3))
const num2 = Number(name2.substr(2, 3))
const alpha1 = name1.substring(0, 2)
const alpha2 = name2.substring(0, 2)
const num1 = Number(name1.substring(2, 5))
const num2 = Number(name2.substring(2, 5))

const numDiff = num2 - num1
const alphaDiff =
Expand Down

0 comments on commit 1d1dc8f

Please sign in to comment.