如何在Javascript中缩短文本

huangapple go评论87阅读模式
英文:

How to shorten text in Javascript

问题

I am trying to reduce the length of the text that I have requested from the API with the 'slice' method, but it is throwing an error of 'Cannot read property 'slice' of undefined.

英文:

I am trying to reduce the length of the text that I have requested from

the API with the 'slice' method. but it is throwing an error of

'Cannot read property 'slice' of undefined.

如何在Javascript中缩短文本

如何在Javascript中缩短文本

答案1

得分: 0

"Cannot read property 'slice' of undefined" 意味着您的 "jobDetails.job_description" 属性在运行时不是字符串类型,而是未定义类型。确保将该属性至少定义为一个空字符串。

英文:

Cannot read property 'slice' of undefined means that your jobDetails.job_description property is not of type string, but of type undefined at runtime. Make sure you have that property at least defined as an empty string.

huangapple
  • 本文由 发表于 2023年5月14日 16:51:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/76246621.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定