ccdavies
ccdavies

Reputation: 1606

Outputting part of an object

I have the following saved into a variable called fieldErrors.

 Object { url_title="This URL title is being ... titles must be unique."}

How can I output just the text within the " "? (This URL title is being ... titles must be unique.)

Upvotes: 0

Views: 24

Answers (1)

Oskar Szura
Oskar Szura

Reputation: 2559

Object literal definition looks rather like that (what you've written is wrong):

obj = { url_title: "This URL title is being ... titles must be unique." } 
console.log(obj.url_title) <- outputting

Upvotes: 1

Related Questions