-
Notifications
You must be signed in to change notification settings - Fork 12
HomeWork3 - js-1 #9
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
base: master
Are you sure you want to change the base?
Conversation
DanilRostov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job. Unfortunately 3.js doesn't work at all.
Anatoly Shlom/1.js
Outdated
| splitAndMerge("Hello World!",",") should return "H,e,l,l,o W,o,r,l,d,!" */ | ||
|
|
||
| function splitAndMerge (str, sp) { | ||
| target=str.split(' ').join('').split('').join(sp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a good way to declare a variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean the "target" variable? What would be better way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh... Now i got it - fixed
| target=str.split(' ').join('').split('').join(sp); | ||
| return target | ||
| } | ||
| console.log(splitAndMerge("Hello there!",",")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current output is H,e,l,l,o,t,h,e,r,e,! instad of H,e,l,l,o t,h,e,r,e,!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but... well... it seems to me that i've been confused with this
splitAndMerge("My name is John"," ") should return "M y n a m e i s J o h n"
(no extra spaces here)
am i missing some logic of how function should work?
| }) | ||
| return target.join(''); | ||
| } | ||
| console.log(toCamelCase("the-stealth-warrior")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Forgot about arr.splice(n,1);
Anatoly Shlom/10.js
Outdated
| Function.prototype.myBind = function () { | ||
| var target = this; | ||
| var args = arguments[0]; | ||
| curArgs = [].slice.call(arguments, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you didn't write var or const here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Anatoly Shlom/10.js
Outdated
| curArgs = [].slice.call(arguments, 1); | ||
| return function() { | ||
| var newArgs = [].slice.call(arguments); | ||
| targetArgs = curArgs.concat(newArgs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed


All 10 functions finished - No global vars, no ES6.