Deleting the .git folder may cause problems in your git repository. If you want to delete all your commit history but keep the code in its current state, it is very safe to do it as in the following: Checkout git checkout –orphan latest_branch Add all the files git add -A Commit the changes git commit -am […]
Tag: push
Slice() method in Javascript
The slice() method returns a shallow copy of a portion of an array into a new array object selected from start to end (end not included) where start and end represent the index of items in that array. The original array will not be modified. Syntax: slice() slice(start) slice(start, end) Parameters start Optional Zero-based index at which to start extraction. A negative index can be used, indicating […]
Pop, Push, Shift and Unshift Array Methods in JavaScript
pop(): Remove an item from the end of an array (returns the removed item) push(parameterToAdd): Add items to the end of an array (returns the new array length) shift(): Remove an item from the beginning of an array (returns the removed item) unshift(parameterToAdd): Add items to the beginning of an array (returns the new array […]