Brian

Results 10 comments of Brian

> I had the same issue and solved it today. (14.03.2021) > You should go to "C:\HashiCorp\Vagrant\embedded\gems\2.2.14\gems\vagrant-2.2.14\bin" address and open "vagrant" file. At the beginning of the file, you will...

> function getString(something: string | number): number { > return something.toString(); > } > 这样写为什么会报错呢、 传入字符串返回字符串,传入数字返回数字 ```typescript function getString(something: string | number): string | number { return something.toString(); } ```...

上一章,跳过先看这里,打卡

> @allenlinc > type NameResolver = () => string;是创建函数吧 是 接收一个函数为参数,左边是输入右边是输出,左边没限制,右边限制为string,具体看函数的类型那部分

> @andyComeOn > > @Deerhound579 > > > @huang-guanhua > > > 好像最后reverse函数的例子,应该还要加上undefined,不然会ts报错吧 > > > > 应该是加void,因为什么都没返回 > > 您说的加 void 是加在哪?能贴一下代码吗。 ```typescript function reverse(x: number): number; function reverse(x:...

> function buildName(firstName: string, lastName: string = 'Cat') { > return firstName + ' ' + lastName; > } > let tomcat = buildName('Tom', 'Cat'); > let tom = buildName('Tom');...