Timeline for Recursive linear search - branch style and layout
Current License: CC BY-SA 3.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 12, 2014 at 6:57 | comment | added | dcorking | I wish I could accept all the answers. I learned a lot from all of them. | |
Sep 12, 2014 at 6:56 | vote | accept | dcorking | ||
Sep 11, 2014 at 11:36 | answer | added | ZeroStatic | timeline score: 2 | |
Sep 11, 2014 at 11:33 | comment | added | ZeroStatic |
A non-block structured if :') if(sentence.length == 0) return false; That's pretty much the only thing I can think of. (Right now, at least)
|
|
Sep 11, 2014 at 11:24 | answer | added | Guffa | timeline score: 2 | |
Sep 11, 2014 at 11:01 | comment | added | dcorking |
In Ruby, I can write return false if sentence.length == 0 as a tidy way to put the termination condition in one line. Does Javascript offer a one-line equivalent to block-structured if?
|
|
Sep 11, 2014 at 10:00 | comment | added | ZeroStatic | Combining everything into one ternary seems even clumsier looking to me. I'd stick with mjolka's answer. return sentence.length == 0 ? false : (sentence[0] === 'A' || containsA(sentence.substr(1)); | |
Sep 11, 2014 at 8:57 | history | tweeted | twitter.com/#!/StackCodeReview/status/509988984294887424 | ||
Sep 11, 2014 at 8:43 | history | edited | dcorking | CC BY-SA 3.0 |
restored accidentally deleted blank lines
|
Sep 11, 2014 at 8:37 | history | edited | dcorking | CC BY-SA 3.0 |
There is no branch tag, so I mention it in title
|
Sep 11, 2014 at 8:28 | answer | added | mjolka | timeline score: 8 | |
Sep 11, 2014 at 8:22 | history | asked | dcorking | CC BY-SA 3.0 |