Created
December 8, 2015 19:55
-
-
Save antiboredom/db0f424d1884c57e3f6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tweet = "These 5 incredible stories from the IDF are sure to leave #inspired"; | |
// turn tweet into an array | |
var words = tweet.split(" "); | |
// get half the length of the words | |
var half_length = Math.ceil(arrayName.length / 2); | |
// get the words on the left side | |
var leftSide = words.splice(0, half_length); | |
var leftWords = leftSide.join(" "); | |
// get the words on the right side | |
var rightWords = words.join(" "); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment