, send email to
jsmentors+unsubscr...@googlegroups.com
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com/
To search via
is the global object). The `this` inside `b`
will be the new object.
Nick
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com
...@googlegroups.com
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com/
To search via a non-Google archive, visit here:
http
:
http://www.mail-archive.com/jsmentors@jsmentors.com/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/jsmentors@googlegroups.com/
To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com
--
Nick Morgan
http://skilldrick.co.uk
On 3 November 2011 10:35, Asen Bozhilov asen.bozhi...@gmail.com wrote:
Nick Morgan:
Now, if you do this instead:
Ctor.prototype = null;
var y = new Ctor;
y.toString;
= function ...
Here's a fiddle that illustrates the above:
http://jsfiddle.net/skilldrick
, but if you're supporting
browsers then chances are you don't have ES5, thus you need underscore]
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors
://www.mail-archive.com/jsmentors@googlegroups.com/
To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view archived discussions from the original JSMentors
'
100% agree. If you're *that* upset by semicolons, use CoffeeScript.
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com
archive, visit here:
http://www.mail-archive.com/jsmentors@googlegroups.com/
To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view archived discussions
'global' array can just be a top level
member of your namespace.
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com/
To search
programmed in a purely prototypal language
either. I'd like to so I can get some ideas as to *how* to do proper
prototypal inheritance in JS. I'm interested to see JavaScript written
in a way that doesn't get overloaded with excessive class-based
baggage.
--
Nick Morgan
http://skilldrick.co.uk
to create instances based on other instances, not on
constructor functions. So you don't need to keep categories clear -
everything is an object, there are no constructor functions. Or am I
missing something?
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http
that the spec
says there is no order means it's actually *useful* for Chrome to do
it differently, as it stops developers from relying on a coincidence.
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view archived discussions from the original
the callback has returned)
whereas with .each it'll happen synchronously (the callback will be
called multiple times with each element before the each function
returns).
Hope that helps!
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view
structure. But trying to get your
head round all of that ^ from a standing start is madness if you ask
me :)
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail
that makes sense :)
Nick
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com/
To search via a non-Google archive, visit here:
http
that adds no *needed* functionality?
The difference between XPath and CSS is that XPath is targeted towards
XML, whereas CSS is targeted towards HTML (primarily). So, when you're
only working with HTML, XPath is un-necessarily verbose.
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save
@jsmentors.com/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/jsmentors@googlegroups.com/
To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http
On 6 September 2011 17:14, gaz Heyes gazhe...@gmail.com wrote:
On 6 September 2011 16:55, Nick Morgan skilldr...@gmail.com wrote:
He said Also when I use `i` modifier I always use upper case letters
in RegExp literal because they are easier for reading, i.e. when he
uses the `i` modifier he
On 26 August 2011 04:43, RobG rg...@iinet.net.au wrote:
On Aug 23, 11:06 pm, Nick Morgan skilldr...@gmail.com wrote:
[...]
The function declaration `createUniqueId` is effectively hoisted to
the top of the script, so it actually *is* defined before you add the
`counter` property
var statement at the top
of the function.
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com/
To search via a non-Google
you use the language because of memory use is just
premature optimisation.
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com
, just that it's possible, as a curiosity. To quote
myself: I'm not suggesting using it in production code, just thought
it was a nice idea :) [I think when people see `eval` a switch
triggers in their brain and they go into survival mode]
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our
in the scope of your `send` function... I would force
string conversion before validating.
Aha, sneaky! Good find.
Cheers
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view archived discussions from the original JSMentors Mailman list:
http
.
Cheers :)
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com/
To search via a non-Google archive, visit here:
http://www.mail
hax0rz)');
});
It gives you access to the value of private vars via a safe eval.
Thought it might come in useful for testing occasionally. I'm not
suggesting using it in production code, just thought it was a nice
idea :) So, what do you think?
Cheers
--
Nick Morgan
http://skilldrick.co.uk
it through).
I agree that exposing private variables is probably better in general.
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com
want some internal functions,
do something like this:
parseColorToString = (function () {
function privateFunction() {}
var privateVar;
return function () {
return 'rgb(0,0,0)';
};
})();
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
using hash-based URLs, or HTML5
pushState where available (if you ask it to).
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com
instantiation of an object is doing in the background. I can
imagine a couple of ways in which this might be useful for security reasons,
although really obscurely. What were you thinking this could be used for?
On Tue, Aug 9, 2011 at 3:25 PM, Nick Morgan skilldr...@gmail.com wrote:
Hi all
Just thought
not creating every time a new FE on each message acceptor
in the dispatcher.
Dmitry.
On 10.08.2011 2:25, Nick Morgan wrote:
Hi all
Just thought I'd share something I had a little fun hacking together
tonight: https://github.com/skilldrick/funcobj
I wanted to see if I could create
-Google archive, visit here:
http://www.mail-archive.com/jsmentors@googlegroups.com/
To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view archived
)
return function () {
//when calling super, make sure self is set to the method receiver
return apply(superObject(methodName, self), arguments);
}
}
log(Method, methodName, not known);
}
return dispatch;
}
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save
via a non-Google archive, visit here:
http://www.mail-archive.com/jsmentors@googlegroups.com/
To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view
of the
JavaScript API is ugly - we can do much better than that.
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
Save our in-boxes! http://emailcharter.org
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com/
To search via a non
something like (cons-stream exprA
exprB) and have to explicitly make a lambda of the second expression
means that it'll never be as expressive as Scheme, and the lack of
tail calls means you need to resort to ugly hacks.
Anyway, glad you enjoyed it!
--
Nick Morgan
http://skilldrick.co.uk
have to rely
on a.b.c being created before you can create a.b.d.
It's partly to do with whether you're creating a library or an
application I guess, and as always, it depends!
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
--
To view archived discussions from the original JSMentors Mailman
On 12 June 2011 21:28, Peter van der Zee jsment...@qfox.nl wrote:
On Sat, Jun 11, 2011 at 8:01 PM, Nick Morgan skilldr...@gmail.com wrote:
I'd really appreciate any feedback/constructive criticism you guys have.
Why did you go for the revealing/factory/functions created in
constructor pattern
this for a blog tutorial on canvas, so I want
the code to be as clear and 'correct' as possible.
I'd really appreciate any feedback/constructive criticism you guys have.
Cheers!
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
--
To view archived discussions from the original JSMentors Mailman list
tired of trying to correct every error and instead focused
on the most important. Do you really want me to correct every post
*and* the errors in your page?
--
Now now you two, keep it civil :)
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
--
To view archived discussions from the original
to
jsmentors+unsubscr...@googlegroups.com
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com/
To search via a non-Google archive, visit here:
http://www.mail-archive.com
Thanks! I'd just been watching some SICP videos when I came up with
the idea for the post, so I had that kind of explanation on my mind
(but I wanted to make it accessible).
Nick
On 26 April 2011 19:47, Peter van der Zee jsment...@qfox.nl wrote:
On Tue, Apr 26, 2011 at 10:48 AM, Nick Morgan
...@googlegroups.com
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/jsmentors@googlegroups.com
Very interesting, you argue your case well :) I'll definitely be
keeping an eye on it!
On 28 March 2011 18:42, Olov Lassus olov.las...@gmail.com wrote:
On Mar 28, 6:54 pm, Nick Morgan skilldr...@gmail.com wrote:
Ok, that makes sense. I can imagine this being a useful tool,
especially on large
to
jsmentors+unsubscr...@googlegroups.com
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com/
To search via a non-Google archive, visit here:
http://www.mail-archive.com
the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/jsmentors@googlegroups.com/
To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com
--
Nick Morgan
http
your
code.
Hear, hear :)
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick http://twitter.com/skilldrick
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com/
To search via a non-Google archive, visit here:
http
.
The accepted way to keep closure compiler from mangling certain names is to
export them - see the docs:
http://code.google.com/closure/compiler/docs/api-tutorial3.html#export
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick http://twitter.com/skilldrick
--
To view archived discussions from
On 15 March 2011 17:29, Nick Morgan skilldr...@gmail.com wrote:
If you're using
[ignore that bit, sorry]
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick http://twitter.com/skilldrick
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com
list:
http://www.mail-archive.com/jsmentors@jsmentors.com/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/jsmentors@googlegroups.com/
To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com
--
Nick Morgan
http://skilldrick.co.uk
Sorry, I've just realised this doesn't work, because it's not waiting for
the script to load. Like Diego said, if you're going to do it this way then
fire the callback on the onload event of the script.
On 8 March 2011 12:12, Nick Morgan skilldr...@gmail.com wrote:
A really basic fix would
;
dialog.setWidth = function( width ) {
dialog.width = width;
}
}
-Mike
Absolutely, I think this is the sanest way to deal with `this` issue.
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick http://twitter.com/skilldrick
--
To view archived discussions from the original JSMentors
wrong, there's a lot of good stuff coming in ES5, but I kinda
wish BE could perform some kind of military coup over the committee - that
would be awesome.
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick http://twitter.com/skilldrick
--
To view archived discussions from the original JSMentors
a non-Google archive, visit here:
http://www.mail-archive.com/jsmentors@googlegroups.com/
To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick http://twitter.com/skilldrick
--
To view archived discussions
years after it was originally
developed - patterns are names given to accepted good practices. Just
because it didn't have a name when it was first developed doesn't mean it
isn't useful for communication for it to have a name now.
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick http
the readability slightly, and I'm not sure
whether that's worth it when i *know* it's not going to affect performance.
Then again, if I got used to using it consistently, the readability issue
wouldn't be so big a deal.
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick http://twitter.com
@googlegroups.com/
To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick http://twitter.com/skilldrick
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors
-expression/
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick http://twitter.com/skilldrick
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com/
To search via a non-Google archive, visit here:
http://www.mail-archive.com
differences. Internally, the difference is whether the grouping operator
returns a function or the result of calling that function.
- peter
What a great explanation :)
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick http://twitter.com/skilldrick
--
To view archived discussions from
/jsmentors@googlegroups.com/
To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.comjsmentors%2bunsubscr...@googlegroups.com
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick http://twitter.com/skilldrick
--
To view archived discussions from the original JSMentors
Actually, it's not a joke, ignore that. Try this:
console.log();
It prints the same thing:
(an empty string)
I see that's basically what Peter wrote - sorry, I didn't read it properly
the first time.
On 14 January 2011 20:24, Nick Morgan skilldr...@gmail.com wrote:
I'm guessing
to
break compatibility because you'll check the number and type of the
arguments.
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick http://twitter.com/skilldrick
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com
in my thinking. Since new has to set up the prototype chain, it
would necessarily have to return an object since primitives do not have
properties and methods. Does this sound right?
Well, you're correct, although I wouldn't have put it like that.
Like what? Big and blue? ;)
--
Nick
to some of the unpleasantries that ensued.
sorry to everyone if i sowed the seeds of discord, i hope we're all
still friends.
-daniel
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick http://twitter.com/skilldrick
--
To view archived discussions from the original JSMentors Mailman list:
http
first, then start refactoring and making it more modular.
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick http://twitter.com/skilldrick
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/jsmentors@jsmentors.com/
To search via a non-Google
/
To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.comjsmentors%2bunsubscr...@googlegroups.com
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick http://twitter.com/skilldrick
--
To view archived discussions from the original JSMentors Mailman list:
http
66 matches
Mail list logo