Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit37d8bba

Browse files
authored
Improved TypeScript
1 parent39dd6f6 commit37d8bba

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎src/main/java/g2601_2700/s2666_allow_one_function_call/solution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function once(fn: Fn): Fn {
66
letwasCalled=false
77
returnfunction(...args){
88
if(!wasCalled){
9-
wasCalled=true;
9+
wasCalled=true
1010
returnfn(...args)
1111
}
1212
}

‎src/test/java/g2601_2700/s2666_allow_one_function_call/solution.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import { once } from 'src/main/java/g2601_2700/s2666_allow_one_function_call/sol
33
import{expect,test}from'vitest'
44

55
test('once',()=>{
6-
constfn=(a,b,c)=>(a+b+c)
7-
constonceFn=once(fn);
6+
constfn=(a,b,c)=>a+b+c
7+
constonceFn=once(fn)
88
expect(onceFn(1,2,3)).toEqual(6)
99
expect(onceFn(2,3,6)).toEqual(undefined)
1010
})
1111

1212
test('once2',()=>{
13-
constfn=(a,b,c)=>(a*b*c)
14-
constonceFn=once(fn);
13+
constfn=(a,b,c)=>a*b*c
14+
constonceFn=once(fn)
1515
expect(onceFn(5,7,4)).toEqual(140)
1616
expect(onceFn(2,3,6)).toEqual(undefined)
1717
expect(onceFn(4,6,8)).toEqual(undefined)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp