console.log()'ing type "any" 变量会导致 Typescript 出错吗?

Will console.log()'ing type "any" variable cause error on Typescript?

我会 console.log(variable: any) 在 Typescript 中,但我不希望它导致错误,我不想在任何地方添加 try{}catch 块。 console.log(any) 会导致任何类型的错误吗?还是它会打印我提供的所有内容?

public print(data:any){
    console.log(data);
}

不,不会。 Typescript用于静态分析代码。

关于控制台日志的 MDN 词汇 (https://developer.mozilla.org/en-US/docs/Web/API/Console/log):

The Console method log() outputs a message to the web console. The message may be a single string (with optional substitution values), or it may be any one or more JavaScript objects.