{"id":27650,"date":"2021-08-01T01:39:10","date_gmt":"2021-08-01T01:39:10","guid":{"rendered":"https:\/\/papersspot.com\/blog\/2021\/08\/01\/js-strings\/"},"modified":"2021-08-01T01:39:10","modified_gmt":"2021-08-01T01:39:10","slug":"js-strings","status":"publish","type":"post","link":"https:\/\/papersspot.com\/blog\/2021\/08\/01\/js-strings\/","title":{"rendered":"JS strings"},"content":{"rendered":"<p>This function will receive an array of products, that looks something like this: <br \/>[<br \/> {<br \/> name: &#8220;Slip Dress&#8221;,<br \/> priceInCents: 8800,<br \/> availableSizes: [0, 2, 4, 6, 10, 12, 16],<br \/> },<br \/> ];<br \/> Depending on the number of items in the array, you will return a different string. In this challenge, you will need to use template literals and the .join() method. <br \/>Note: If you believe you have written the function correctly but are not getting passing tests, make sure to check the spelling and punctuation of the returned strings.No items <br \/>If there are no items, you should return a message that says: <br \/>There are no items for sale. <br \/>One item <br \/>If there is only one item, you should return a message that says like: <br \/>There is 1 item for sale: Slip Dress. <br \/>Replace &#8220;Slip Dress&#8221; with the name of whatever the item is. <br \/>Two items <br \/>If there are two items, you should return a message that says: <br \/>There are 2 items for sale: Hat and Shirt. <br \/>Replace &#8220;Hat&#8221; and &#8220;Shirt&#8221; with the name of whatever the item is. <br \/>More than two items <br \/>If there are more than two items, you should return a message that says: <br \/>There are 3 items for sale: Hat, Shirt, Square-Neck Jumpsuit. <br \/>Replace &#8220;3&#8221; with the number of items for sale and &#8220;Hat&#8221;, &#8220;Shirt&#8221;, and &#8220;Square-Neck Jumpsuit&#8221; with the names of the items. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>This function will receive an array of products, that looks something like this: [ { name: &#8220;Slip Dress&#8221;, priceInCents: 8800, availableSizes: [0, 2, 4, 6, 10, 12, 16], }, ]; Depending on the number of items in the array, you will return a different string. In this challenge, you will need to use template literals [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10],"class_list":["post-27650","post","type-post","status-publish","format-standard","hentry","category-research-paper-writing","tag-writing"],"_links":{"self":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/27650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/comments?post=27650"}],"version-history":[{"count":0,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/27650\/revisions"}],"wp:attachment":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/media?parent=27650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/categories?post=27650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/tags?post=27650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}