javascript脑筋急转弯 [英] javascript brainteasers

查看:61
本文介绍了javascript脑筋急转弯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人知道或知道在哪里可以找到

javascriptbrain teasers的集合。因为缺乏更好的描述。

公司在招聘时一直使用这些类型的测试程序员。我已经设法在这里和那里找到了几个问题..对于

例子(我将为你的娱乐留下以下未答复):


*****注意 - 我对这些问题的答案不感兴趣,只是很好奇,因为

到了我可以找到的地方。


- div.setAttribute(''attr'',val)何时不等于div.attr = val?


- 这两个陈述之间的区别是什么:

1. var x = 3;

2. x = 3;


- 有什么区别? :

1. !!(obj1&& obj2)

2.(obj1&& obj2)


- 编写一行JavaScript代码,连接传入函数的所有

字符串:

函数连接(/ *任意数量的字符串* /){

var string = / *这里你的一行* /

返回字符串;

}

- 什么这两个例子有共同之处吗?


1. var ob j = document.getElementById(''adiv'');

document.getElementById(''adiv'')。ptr = obj;


2。 function assignClick(){

var el = document.createElement(''div'');

function handleClick(){el.innerHTML =''clicked!'' ; }

el.attachEvent(''onclick'',handleClick);

}


我喜欢这些东西。如果有人能指点我一些,非常感谢。

解决方案

在文章< 11 ******** *************@b75g2000hsg.googlegroups。 com>,

" Walton" < jr ****** @ gmail.comwrote:


我想知道是否有人知道或知道在哪里可以找到
的集合
javascript" brain teasers"因为缺乏更好的描述。

公司在招聘时一直使用这些类型的测试程序员。我已经设法在这里和那里找到了几个问题..对于

例子(我将为你的娱乐留下以下未答复):


*****注意 - 我对这些问题的答案不感兴趣,只是很好奇,因为

到了我可以找到的地方。


- div.setAttribute(''attr'',val)何时不等于div.attr = val?


- 这两个陈述之间的区别是什么:

1. var x = 3;

2. x = 3;


- 有什么区别? :

1. !!(obj1&& obj2)

2.(obj1&& obj2)


- 编写一行JavaScript代码,连接传入函数的所有

字符串:

函数连接(/ *任意数量的字符串* /){

var string = / *这里你的一行* /

返回字符串;

}


- 这两个是什么exa mples有共同点吗?


1. var obj = document.getElementById(''adiv'');

document.getElementById(''adiv'' ).ptr = obj;


2.函数assignClick(){

var el = document.createElement(''div'');

函数handleClick(){el.innerHTML =''点击!''; }

el.attachEvent(''onclick'',handleClick);

}


我喜欢这些东西。如果有人能指点我一些,非常感谢。



好​​笑,我会请程序员给我看一些文件

他们写的,他们如何防御性编码,他们如何编码边缘

案例,他们如何进行测试,他们如何设计可扩展性和一般性

他们所做的事情。


你可以随时让IQ-200智能裤极客写聪明,

难以理解,不可维护的代码(很难写,应该

难以理解学校编码)。我不会雇用它们。


- tim


3月27日上午11点40分,Tim Streater< ; tim.strea ... @ dante.org.ukwrote:


文章< 1175008593.590948.27 ... @ b75g2000hsg.googlegroups。 com>,


" Walton" < jrhol ... @ gmail.comwrote:


我想知道是否有人知道或知道在哪里可以找到
$ b $的集合b javascriptbrain teasers因为缺乏更好的描述。

公司在招聘时一直使用这些类型的测试程序员。我已经设法在这里和那里找到了几个问题..对于

例子(我将保留以下未解答的内容):


*****注意 - 我对这些问题的答案不感兴趣,只是好奇,因为

到了我可以找到的地方。


- div.setAttribute(''attr'',val)何时不等于div.attr = val?


- 这两个陈述之间有什么区别:

1. var x = 3;

2. x = 3;


- 有什么区别:

1. !!(obj1&& obj2)

2.(obj1&& obj2)


- 编写一行JavaScript代码,连接所有传入函数的
字符串:

函数连接(/ *任意数量的字符串* /){

var string = / *你的一行* /

返回字符串;

}


- 做什么这两个例子有共同之处吗?


1. var obj = document.getElementById(''adiv'');

document.getElementById('' adiv'')。ptr = obj;


2. function assignClick(){

var el = document.createElement(''div'');

函数handleClick(){el.innerHTML =''点击!''; }

el.attachEvent(''onclick'',handleClick);

}

$ b $我喜欢这些东西。如果有人能指点我一些,非常感谢。



好​​笑,我会请程序员给我看一些文件

他们写的,他们如何防御性编码,他们如何编码边缘

案例,他们如何进行测试,他们如何设计可扩展性和一般性




为什么我会关心你如何雇用人员?这不是帖子

的内容。


你总能得到IQ-200聪明裤的极客来写聪明的,

难以理解,无法维护的代码(很难写,它应该很难理解编码学校)。我不会雇用它们。


- tim



所以换句话说,不,你不要''知道在哪里找到任何大脑

teasers。

感谢


在文章< 11 ***********************@p77g2000hsh.googlegroups .com> ;,

" Walton" < jr ****** @ gmail.comwrote:


3月27日上午11点40分,Tim Streater< tim.strea ... @ dante.org.ukwrote:


文章< 1175008593.590948.27 ... @ b75g2000hsg.googlegroups。 com>,


" Walton" < jrhol ... @ gmail.comwrote:


我想知道是否有人知道或知道在哪里可以找到
$ b $的集合b javascriptbrain teasers因为缺乏更好的描述。

公司在招聘时一直使用这些类型的测试程序员。我已经设法在这里和那里找到了几个问题..对于

例子(我将保留以下未解答的内容):


*****注意 - 我对这些问题的答案不感兴趣,只是好奇,因为

到了我可以找到的地方。


- div.setAttribute(''attr'',val)何时不等于div.attr = val?


- 这两个陈述之间有什么区别:

1. var x = 3;

2. x = 3;


- 有什么区别:

1. !!(obj1&& obj2)

2.(obj1&& obj2)


- 编写一行JavaScript代码,连接所有传入函数的
字符串:

函数连接(/ *任意数量的字符串* /){

var string = / *你的一行* /

返回字符串;

}


- 做什么这两个例子有共同之处吗?


1. var obj = document.getElementById(''adiv'');

document.getElementById('' adiv'')。ptr = obj;


2. function assignClick(){

var el = document.createElement(''div'');

函数handleClick(){el.innerHTML =''点击!''; }

el.attachEvent(''onclick'',handleClick);

}

$ b $我喜欢这些东西。如果有人能指点我一些,非常感谢。



好​​笑,我会请程序员给我看一些文件

他们写的,他们如何防御性编码,他们如何编码边缘

案例,他们如何进行测试,他们如何设计可扩展性和一般性




为什么我会关心你如何雇用人员?这不是帖子

的意思。



然后不要吹嘘,好像这很正常, - 不,值得称赞 -

公司使用这个作为一种选择技术。


你总能得到IQ-200智能裤的极客来写聪明,

难以理解,不可维护的代码(很难写,它应该很难理解编码学校)。我不会雇用它们。


- tim



所以换句话说,不,你不要''知道在哪里找到任何大脑

teasers。

谢谢



任何时候。试试当地的书店 - 你知道,这些书架上有Sod-Yokos和其他有用物品的

系列。


- 蒂姆


I''m wondering if anyone knows or knows where to find a collection of
javascript "brain teasers" for lack of a better description.
Companies use these types of tests for programmers all the time when
hiring. I''ve managed to find a few questions here and there.. for
example (i''ll leave the following unanswered for your amusement):

*****NOTE -- i''m not interested in answers to these, just curious as
to where I can find some more.

-- When does div.setAttribute(''attr'', val) not equal div.attr = val?

-- What''s the difference between these two statements:
1. var x = 3;
2. x = 3;

-- What''s the difference between:
1. !!(obj1 && obj2)
2. (obj1 && obj2)

-- Write a one-line piece of JavaScript code that concatenates all
strings passed into a function:
function concatenate(/* any number of strings */) {
var string = /* your one line here */
return string;
}
-- What do these two examples have in common?

1. var obj = document.getElementById(''adiv'');
document.getElementById(''adiv'').ptr = obj;

2. function assignClick() {
var el = document.createElement(''div'');
function handleClick() { el.innerHTML = ''clicked!''; }
el.attachEvent(''onclick'', handleClick);
}

I love these things. If anyone can point me to some more, many thanks.

解决方案

In article <11*********************@b75g2000hsg.googlegroups. com>,
"Walton" <jr******@gmail.comwrote:

I''m wondering if anyone knows or knows where to find a collection of
javascript "brain teasers" for lack of a better description.
Companies use these types of tests for programmers all the time when
hiring. I''ve managed to find a few questions here and there.. for
example (i''ll leave the following unanswered for your amusement):

*****NOTE -- i''m not interested in answers to these, just curious as
to where I can find some more.

-- When does div.setAttribute(''attr'', val) not equal div.attr = val?

-- What''s the difference between these two statements:
1. var x = 3;
2. x = 3;

-- What''s the difference between:
1. !!(obj1 && obj2)
2. (obj1 && obj2)

-- Write a one-line piece of JavaScript code that concatenates all
strings passed into a function:
function concatenate(/* any number of strings */) {
var string = /* your one line here */
return string;
}
-- What do these two examples have in common?

1. var obj = document.getElementById(''adiv'');
document.getElementById(''adiv'').ptr = obj;

2. function assignClick() {
var el = document.createElement(''div'');
function handleClick() { el.innerHTML = ''clicked!''; }
el.attachEvent(''onclick'', handleClick);
}

I love these things. If anyone can point me to some more, many thanks.

Funny, I would be asking the programmers to show me some documentation
they have written, how they code defensively, how they code for edge
cases, how they do testing, how they design extensibility and generality
into what they do.

You can always get IQ-200 smartie-pants geeks to write clever,
impenetrable, unmaintainable code (the "it was hard to write, it should
be hard to understand" school of coding). I wouldn''t employ them.

-- tim


On Mar 27, 11:40 am, Tim Streater <tim.strea...@dante.org.ukwrote:

In article <1175008593.590948.27...@b75g2000hsg.googlegroups. com>,

"Walton" <jrhol...@gmail.comwrote:

I''m wondering if anyone knows or knows where to find a collection of
javascript "brain teasers" for lack of a better description.
Companies use these types of tests for programmers all the time when
hiring. I''ve managed to find a few questions here and there.. for
example (i''ll leave the following unanswered for your amusement):

*****NOTE -- i''m not interested in answers to these, just curious as
to where I can find some more.

-- When does div.setAttribute(''attr'', val) not equal div.attr = val?

-- What''s the difference between these two statements:
1. var x = 3;
2. x = 3;

-- What''s the difference between:
1. !!(obj1 && obj2)
2. (obj1 && obj2)

-- Write a one-line piece of JavaScript code that concatenates all
strings passed into a function:
function concatenate(/* any number of strings */) {
var string = /* your one line here */
return string;
}

-- What do these two examples have in common?

1. var obj = document.getElementById(''adiv'');
document.getElementById(''adiv'').ptr = obj;

2. function assignClick() {
var el = document.createElement(''div'');
function handleClick() { el.innerHTML = ''clicked!''; }
el.attachEvent(''onclick'', handleClick);
}

I love these things. If anyone can point me to some more, many thanks.


Funny, I would be asking the programmers to show me some documentation
they have written, how they code defensively, how they code for edge
cases, how they do testing, how they design extensibility and generality
into what they do.

why would i care how you would hire people? that''s not what the post
is about.

You can always get IQ-200 smartie-pants geeks to write clever,
impenetrable, unmaintainable code (the "it was hard to write, it should
be hard to understand" school of coding). I wouldn''t employ them.

-- tim

so in other words, no, you don''t know where to find any brain
teasers.
thanks


In article <11**********************@p77g2000hsh.googlegroups .com>,
"Walton" <jr******@gmail.comwrote:

On Mar 27, 11:40 am, Tim Streater <tim.strea...@dante.org.ukwrote:

In article <1175008593.590948.27...@b75g2000hsg.googlegroups. com>,

"Walton" <jrhol...@gmail.comwrote:

I''m wondering if anyone knows or knows where to find a collection of
javascript "brain teasers" for lack of a better description.
Companies use these types of tests for programmers all the time when
hiring. I''ve managed to find a few questions here and there.. for
example (i''ll leave the following unanswered for your amusement):

*****NOTE -- i''m not interested in answers to these, just curious as
to where I can find some more.

-- When does div.setAttribute(''attr'', val) not equal div.attr = val?

-- What''s the difference between these two statements:
1. var x = 3;
2. x = 3;

-- What''s the difference between:
1. !!(obj1 && obj2)
2. (obj1 && obj2)

-- Write a one-line piece of JavaScript code that concatenates all
strings passed into a function:
function concatenate(/* any number of strings */) {
var string = /* your one line here */
return string;
}

-- What do these two examples have in common?

1. var obj = document.getElementById(''adiv'');
document.getElementById(''adiv'').ptr = obj;

2. function assignClick() {
var el = document.createElement(''div'');
function handleClick() { el.innerHTML = ''clicked!''; }
el.attachEvent(''onclick'', handleClick);
}

I love these things. If anyone can point me to some more, many thanks.

Funny, I would be asking the programmers to show me some documentation
they have written, how they code defensively, how they code for edge
cases, how they do testing, how they design extensibility and generality
into what they do.


why would i care how you would hire people? that''s not what the post
is about.

Then don''t tout it as if it''s quite normal, - nay, laudable - for
companies to use this as a selection technique.

You can always get IQ-200 smartie-pants geeks to write clever,
impenetrable, unmaintainable code (the "it was hard to write, it should
be hard to understand" school of coding). I wouldn''t employ them.

-- tim


so in other words, no, you don''t know where to find any brain
teasers.
thanks

Any time. Try the local bookstore - you know, the shelves that have the
collections of Sod-Yokos and other useful items.

-- tim


这篇关于javascript脑筋急转弯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆