Skip to content

London | 26-SDC-Mar | Beko | Sprint 2 | jq#413

Open
Abubakar-Meigag wants to merge 1 commit intoCodeYourFuture:mainfrom
Abubakar-Meigag:beko-jq-exercises
Open

London | 26-SDC-Mar | Beko | Sprint 2 | jq#413
Abubakar-Meigag wants to merge 1 commit intoCodeYourFuture:mainfrom
Abubakar-Meigag:beko-jq-exercises

Conversation

@Abubakar-Meigag
Copy link
Copy Markdown
Contributor

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

I completed exercises for Jq

@Abubakar-Meigag Abubakar-Meigag added 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Tools The name of the module. labels Mar 23, 2026
Comment thread jq/script-05.sh
# TODO: Write a command to output the names of each player, as well as their city.
# Your output should contain 6 lines, each with two words on it.

jq -r '.[].name + ", " + .[].city' scores.json No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command produces more than 6 lines of output.

Comment thread jq/script-06.sh
# Your output should contain 6 lines, each with one word and one number on it.
# The first line should be "Ahmed 1" with no quotes.

jq -r '.[] | .name + " " + (.scores[0] | tostring)' scores.json No newline at end of file
Copy link
Copy Markdown

@cjyuan cjyuan May 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tostring is optional when the value is to be concatenated with another string.

Sorry, I mixed up with JS.

But it is optional in "string interpolation". For example:

jq -r '.[] | "\(.name) \(.scores[0])' scores.json

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Tools The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants