목록exercism (7)
devGYU World

본 예제는 이름 문자열이 주어졌을 때 이름을 포함한 문자열을 반환하거나, 이름이 주어지지 않았다면 'you'로 대체 되어 문자열을 반환해야 한다. 이름이 주어지지 않았을 때 'you'라는 문자열이 대입되는건 다르게 말하면 초기값을 'you'라고 설정해야 한다고 볼 수 있다. 이처럼 변수의 초기값을 설정한 채 함수에 넣기 위해서는 Dart의 위치적 선택 매개변수를 함수에 넣어주면 된다. // []를 활용하면 매개변수가 위치적 선택 매개변수 임을 나타낸다 String twoFer([String name = 'you']) { return "One for $name, one for me."; } 참고 Two Fer in Dart on Exercism Can you solve Two Fer in Dart? Imp..

본 문제는 가장 기본적인 "Hello world"를 리턴하는 예제이다. 예제를 풀기 위한 코드는 아래와 같다. class HelloWorld { String hello() { return "Hello, World!"; } } 참고 Hello World in Dart on Exercism Can you solve Hello World in Dart? Improve your Dart skills with support from our world-class team of mentors. exercism.org GitHub - gyu0710/dart: Exercism Dart Solutions Exercism Dart Solutions. Contribute to gyu0710/dart development by..