-5

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.

enter image description here

enter image description here

Louigee
  • 5
  • 3
  • 1
    also [don't post images of code](https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors) – pilchard May 14 '23 at 09:05

1 Answers1

0

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.