codewars - Broken Greetings
2014-04-15 10:30
141 查看
http://www.codewars.com/
Description:
Correct this code, so that the greet function returns the expected value.
[b]MySolution:[/b]
Best Solution:
Broken Greetings
Description:
Correct this code, so that the greet function returns the expected value.
[b]MySolution:[/b]
function Person(name){ this.name = name; } Person.prototype.greet = function(otherName){ return "Hi " + otherName + ", my name is " + name; }
Best Solution:
function Person(name){ this.name = name; } Person.prototype.greet = function(otherName){ return "Hi " + otherName + ", my name is " + this.name; }
相关文章推荐
- Codewars-Javascript训练手册:正则表达式(上)
- [从codewars学习到的JS系列1]数组方法reduce(),map(),正则$1等的使用
- 【Codewars-snail】顺时针打印矩阵(python)
- [codewars]4.找到数组中唯一奇偶异常元素
- Rust: codewars的prize draw算法
- [Haskell] CodeWars|Bouncing Balls
- Python-CodeWars-17-11-26
- [Codewars]-Sudoku Solution Validator
- 菜圈的codewars(一),codewars的注册
- [从codewars学习到的JS系列2]正则表达式中的exec()与字符串的match()方法区别
- 【Codewars-求矩阵行列式】python
- [codewars]5.Series: 1 + 1/4 + 1/7 + 1/10 + 1/13 + 1/16 +...
- codewars解题笔记 —— 字符串的筛选和拼接
- Rust: codewars的Bleatrix Trotter
- 【codewars】Mumbling
- [Codewars]-Roman Numerals Encoder
- 开发者可以在Codewars上面学习各种编程语言,Codewars的奖励系统激励程序员们像打游戏升级一样地做习题。
- 菜圈的codewars(二),输入输出
- [从codewars学习到的JS系列3]数组filter方法与函数call方法妙用
- codeWars的一道题目而已