These are chat archives for codefellows/sea-c16-javascript

15th
Jul 2014
Hank Yates
@hankyates
Jul 15 2014 01:29
console.log(arguments)
@CodeErCn console.log(arguments)
CTownsdin
@CTownsdin
Jul 15 2014 01:47
hello all my fellow students in Foundations II JS class...
Hank Yates
@hankyates
Jul 15 2014 01:58
oh hai
srobertson421
@srobertson421
Jul 15 2014 02:23
If anyone is looking for extra reading material on closures, scoping, and other JS topics I found this site to be awesome!
http://javascriptissexy.com
CTownsdin
@CTownsdin
Jul 15 2014 02:41
thanks for sharing
srobertson421
@srobertson421
Jul 15 2014 03:02
You bet!
Nicholas Weber
@NEWeber
Jul 15 2014 04:28
Hey, would someone be able to grab my water bottle? I left it on the front table. I'll pick it up on Wednesday.
Tyler Morgan
@toastynerd
Jul 15 2014 04:54
@NEWeber I can grab it tomrrow morning and stash it in the kitchen downstairs.
Eric Chen
@CodeErCn
Jul 15 2014 06:52
Help! I am have trouble slice the string within a function
var stringDelimiter = function(stringInput, seperatorInput) {
var stringArray = [];
var index = 0;
var separatorPosition;
var stringScope = stringInput;
separatorPosition = stringScope.indexOf(seperatorInput);
if(separatorPosition == 0){
stringScope.slice(0,1);
}else{
stringArray[index] = stringScope.slice(0, separatorPosition);
stringScope.slice(0,2);
index++;
}
}
Hank Yates
@hankyates
Jul 15 2014 07:26
@CodeErCn wrap that code block in 3 back ticks ```
var stringDelimiter = function(stringInput, seperatorInput) {
var stringArray = [];
var index = 0;
var separatorPosition;
var stringScope = stringInput;
separatorPosition = stringScope.indexOf(seperatorInput);
if(separatorPosition == 0){
stringScope.slice(0,1);
}else{
stringArray[index] = stringScope.slice(0, separatorPosition);
stringScope.slice(0,2);
index++;
}
}
itll respect the indentation
Eric Chen
@CodeErCn
Jul 15 2014 07:43
Hi hanks would you please type it our in code?? I am not quiet understand.
Ivan Storck
@ivanoats
Jul 15 2014 17:20
Hank Yates
@hankyates
Jul 15 2014 18:18
@CodeErCn try reading this to see if it makes markdown a little more clear https://daringfireball.net/projects/markdown/basics
Scott Romney Burbidge
@sburbidg
Jul 15 2014 19:11
@CodeErCn @hankyates daringfireball is great for the basics. In the syntax tab it shows what the markdown code would look like if you had to write it in HTML. Since I just skimmed it I thought the HTML was the markdown so be careful of that.
Hank Yates
@hankyates
Jul 15 2014 19:23
ah interesting
have a better resource for it?
ctrl+alt+m
@CodeErCn @sburbidg ctrl+alt+m
Scott Romney Burbidge
@sburbidg
Jul 15 2014 19:26
@hankyates @CodeErCn No I think it is a great source you just have to actually read it . I just ran into trouble because I assumed I knew what was going on already and just skimmed it (AKA didn't really read the explanations).
Scott Romney Burbidge
@sburbidg
Jul 15 2014 19:34
Was gonna say one of you smart people should make a gitter app but...
posted from the gutter app
Hank Yates
@hankyates
Jul 15 2014 19:34
well the android app is on its way
anyone here using the iphone app?
and is it any good?
Scott Romney Burbidge
@sburbidg
Jul 15 2014 19:34
I am
So far it is good. You can't edit is the only annoying thing. It is cool to have it push notifications though.
Also you can't see who has read your post but those are pretty minor things. I am assuming it is open source so someone could probably add those features.
Hank Yates
@hankyates
Jul 15 2014 19:38
yeah
sometimes they strip features on native apps to light the network load
Scott Romney Burbidge
@sburbidg
Jul 15 2014 19:38
Makes sense
Probably can't do code blocks either. Though that would be cumbersome anyways.
does this work
Hank Yates
@hankyates
Jul 15 2014 19:49
yup
Joe Elsey
@joeelsey
Jul 15 2014 21:54
Still trying to figure out the delimiter homework from last night. What is 'undefined is not a function'?
Tyler Morgan
@toastynerd
Jul 15 2014 21:55
Yeah, you’ll see that a lot it means you’re trying to call function that doesn’t exist. Most likely you have a syntax error somewhere
Scott Romney Burbidge
@sburbidg
Jul 15 2014 21:59
Anyone know a way to change the elements of an array back into a string?
Ivan Storck
@ivanoats
Jul 15 2014 21:59
you mean from int?
Scott Romney Burbidge
@sburbidg
Jul 15 2014 22:01
Like if you have an array [a, r, e] can you make it 'are'?
Tyler Morgan
@toastynerd
Jul 15 2014 22:02
.join
specifiy a deliminator
.join(‘ ‘) for instance will put a space between each element
[‘a’,’r’,’e’].join(‘’); //=> returns ‘are’
Scott Romney Burbidge
@sburbidg
Jul 15 2014 22:03
I kno
Oh cool
I couldn't get it to not have commas in between it.
I didn't mean to send I know
Thanks
Tyler Morgan
@toastynerd
Jul 15 2014 22:05
np
Ivan Storck
@ivanoats
Jul 15 2014 22:06
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join - my google-fu shortcut is “MDN join” - “MDN [method]” usually ends up in the right place. Or use http://devdocs.io
Tyler Morgan
@toastynerd
Jul 15 2014 22:07
but if you’re pushing individual characters into an array and need a string you’d be better off concatenating onto an empty string
var outputString = ‘’;
outputString += myCharacter;
Scott Romney Burbidge
@sburbidg
Jul 15 2014 22:09
Oh that's cool. I didn't know you could populate an empty s
String
Tyler Morgan
@toastynerd
Jul 15 2014 22:10
Yeah, it’s insanely useful.
Scott Romney Burbidge
@sburbidg
Jul 15 2014 22:16
Yeah. I have been trying to find a simple way to do that. So could myCharacter be an array or do you need to pop() it out of the array first?
Scott Romney Burbidge
@sburbidg
Jul 15 2014 22:24
nvm I figured it out
Kristoffer Hebert
@hirekris
Jul 15 2014 22:49
How do I make it so when someone calls Add() it also Executes Add.add()
?
Brent Parrish
@bparrish206
Jul 15 2014 23:03
I finished the deliminator assignment but I was using git on two different computers and i think I broke it with a merge conflict. I'm trying to sort through it now but git is saying its locked. Should I just create a new fork?
Tyler Morgan
@toastynerd
Jul 15 2014 23:29
@hirekris You’re close but in your counter decorator you should leave func a function that can be called and increment the count when it’s called. I know that’s vague but I want you to figure it out on your own, let me know if you need me to be more specific.
@bparrish206 You shouldn’t need to create a new fork, push one up to github then call git pull from the other, fix the merge conflicts and re push
@bparrish206 I haven’t watched through the whole thing but this video tutorial looks pretty good: https://www.youtube.com/watch?v=zz7NuSCH6II
Kristoffer Hebert
@hirekris
Jul 15 2014 23:45
I could use some more hints. I assume I am modify the Add function within countDecorator and returning a updated Add function
Tyler Morgan
@toastynerd
Jul 15 2014 23:48
function decorator(inputFunc) {
  return function() {
    console.log(‘something awesome!’);
    inputFunc();
  }
}
you would then use it like this:
var decorated = decorator(function() {
  console.log(‘hello world!’);
});
decorated() //=> outputs ‘something awesome’ then ‘hello world!’
does that help?
Kristoffer Hebert
@hirekris
Jul 15 2014 23:51
I guess so how would i pass arguments dynamically
Kristoffer Hebert
@hirekris
Jul 15 2014 23:52
Ok thanks
Tyler Morgan
@toastynerd
Jul 15 2014 23:56
np