Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Taken: es/0-12.md #276

Open
1 task
frivas opened this issue Nov 9, 2018 · 1 comment
Open
1 task

Taken: es/0-12.md #276

frivas opened this issue Nov 9, 2018 · 1 comment
Labels
es Translation to ES question Further information is requested

Comments

@frivas
Copy link
Collaborator

frivas commented Nov 9, 2018

  • 0-12.md translation to ES
@frivas frivas added the es Translation to ES label Nov 10, 2018
@frivas
Copy link
Collaborator Author

frivas commented Nov 15, 2018

Sorry for the delay with this one. @twostraws I found a possible typo in the original file, in the section
"## Force unwrapping optionals" there is a function as follows:

    func yearAlbumReleased(name: String) -> Int? {
        if name == "Taylor Swift" { return 2006 }
        if name == "Fearless" { return 2008 }
        if name == "Speak Now" { return 2010 }
        if name == "Red" { return 2012 }
        if name == "1989" { return 2014 }

        return nil
    }

    var year = yearAlbumReleased(name: "Red")

    if year == nil {
        print("There was an error")
    } else {
        print("It was released in \(year)")
    }

The explanation below it:

That gets the year an album was released. If the album couldn't be found, year will be set to nil, and an error message will be printed. Otherwise, the year will be printed.

I understand that what you are passing to the function when calling it is the name of the album not the year. What I understand from this sentence "That gets the year an album was released" is the function receives the year, which is not right. Am I wrong in this one?. If not, then probably it needs to be changed. What do you think?.

Thank you in advanced.
Have a great one.

@frivas frivas added the question Further information is requested label Nov 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
es Translation to ES question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant