Skip to main content
edited body
Source Link
palerdot
  • 269
  • 2
  • 7

PHP version:

 echo strlen("Douglas Adams")+strlen("born on")+array_sum(array(1,9,5,21,0,3,1,19,5,2)); /* array(1,9,5,21,0,3,1,19,5,2) => March 11, 1952 */ 

JavaScript version:

 console.log("Douglas Adams".length + "born on".length + [1,9,5,21,0,3,1,1]9,5,2].reduce(function(previousValue, currentValue, index, array){return previousValue + currentValue;})); /* [1,9,5,21,0,3,1,1]9,5,2] => March 11, 1952 */ 

Output:

 42 

PHP version:

 echo strlen("Douglas Adams")+strlen("born on")+array_sum(array(1,9,5,2,0,3,1,1)); /* array(1,9,5,2,0,3,1,1) => March 11, 1952 */ 

JavaScript version:

 console.log("Douglas Adams".length + "born on".length + [1,9,5,2,0,3,1,1].reduce(function(previousValue, currentValue, index, array){return previousValue + currentValue;})); /* [1,9,5,2,0,3,1,1] => March 11, 1952 */ 

Output:

 42 

PHP version:

 echo strlen("Douglas Adams")+strlen("born on")+array_sum(array(1,1,0,3,1,9,5,2)); /* array(1,1,0,3,1,9,5,2) => March 11, 1952 */ 

JavaScript version:

 console.log("Douglas Adams".length + "born on".length + [1,1,0,3,1,9,5,2].reduce(function(previousValue, currentValue, index, array){return previousValue + currentValue;})); /* [1,1,0,3,1,9,5,2] => March 11, 1952 */ 

Output:

 42 
deleted 4 characters in body
Source Link
palerdot
  • 269
  • 2
  • 7

PHP version:

 echo strlen("Douglas Adams")+strlen("born on")+array_sum(array(3,1,1,1,9,5,2,0,3,1,1)); /* array(3,1,1,1,9,5,2,0,3,1,1) => March 11, 1952 */ 

JavaScript version:

 console.log("Douglas Adams".length + "born on".length + [3[1, 19, 15, 12, 90, 53, 2]1,1].reduce(function(previousValue, currentValue, index, array){return previousValue + currentValue;})); /* [3[1, 19, 15, 12, 90, 53, 2]1,1] => March 11, 1952 */ 

Output:

 42 

PHP version:

 echo strlen("Douglas Adams")+strlen("born on")+array_sum(array(3,1,1,1,9,5,2)); /* array(3,1,1,1,9,5,2) => March 11, 1952 */ 

JavaScript version:

 console.log("Douglas Adams".length + "born on".length + [3, 1, 1, 1, 9, 5, 2].reduce(function(previousValue, currentValue, index, array){return previousValue + currentValue;})); /* [3, 1, 1, 1, 9, 5, 2] => March 11, 1952 */ 

Output:

 42 

PHP version:

 echo strlen("Douglas Adams")+strlen("born on")+array_sum(array(1,9,5,2,0,3,1,1)); /* array(1,9,5,2,0,3,1,1) => March 11, 1952 */ 

JavaScript version:

 console.log("Douglas Adams".length + "born on".length + [1,9,5,2,0,3,1,1].reduce(function(previousValue, currentValue, index, array){return previousValue + currentValue;})); /* [1,9,5,2,0,3,1,1] => March 11, 1952 */ 

Output:

 42 
Syntax coloring
Source Link
Victor Stafusa
  • 8.8k
  • 5
  • 42
  • 63

PHP version:

 echo strlen("Douglas Adams")+strlen("born on")+array_sum(array(3,1,1,1,9,5,2)); /* array(3,1,1,1,9,5,2) => March 11, 1952 */ 
 echo strlen("Douglas Adams")+strlen("born on")+array_sum(array(3,1,1,1,9,5,2)); /* array(3,1,1,1,9,5,2) => March 11, 1952 */ 

JavaScript version:

 console.log("Douglas Adams".length + "born on".length + [3, 1, 1, 1, 9, 5, 2].reduce(function(previousValue, currentValue, index, array){return previousValue + currentValue;})); /* [3, 1, 1, 1, 9, 5, 2] => March 11, 1952 */ 
 console.log("Douglas Adams".length + "born on".length + [3, 1, 1, 1, 9, 5, 2].reduce(function(previousValue, currentValue, index, array){return previousValue + currentValue;})); /* [3, 1, 1, 1, 9, 5, 2] => March 11, 1952 */ 

Output:

 42 

PHP version:

 echo strlen("Douglas Adams")+strlen("born on")+array_sum(array(3,1,1,1,9,5,2)); /* array(3,1,1,1,9,5,2) => March 11, 1952 */ 

JavaScript version:

 console.log("Douglas Adams".length + "born on".length + [3, 1, 1, 1, 9, 5, 2].reduce(function(previousValue, currentValue, index, array){return previousValue + currentValue;})); /* [3, 1, 1, 1, 9, 5, 2] => March 11, 1952 */ 

Output:

 42 

PHP version:

 echo strlen("Douglas Adams")+strlen("born on")+array_sum(array(3,1,1,1,9,5,2)); /* array(3,1,1,1,9,5,2) => March 11, 1952 */ 

JavaScript version:

 console.log("Douglas Adams".length + "born on".length + [3, 1, 1, 1, 9, 5, 2].reduce(function(previousValue, currentValue, index, array){return previousValue + currentValue;})); /* [3, 1, 1, 1, 9, 5, 2] => March 11, 1952 */ 

Output:

 42 
Copy edited. Removed historical information.
Source Link
Doorknob
  • 72.1k
  • 20
  • 146
  • 393
Loading
added 26 characters in body
Source Link
palerdot
  • 269
  • 2
  • 7
Loading
added 462 characters in body
Source Link
palerdot
  • 269
  • 2
  • 7
Loading
Source Link
palerdot
  • 269
  • 2
  • 7
Loading