Articles - Web design, web development, technology, mobile dev
The split method separates the string into substrings, which are separated by a given separator. The separator can be a blank space, comma or whatever you need.
The reverse method changes the order of the element in the array in situ at call time. The zeroeth element will become the last element in the array and the last element the first in the array.
The join method will recombine all the given items in the array and then return the array.
Here are some useful kubernetes commands for future to me to look back on and remember. Maybe you find them useful too.
kubectl get po
kubectl get po -w
-w is for watch so you can watch your pods die and come back to life
kubectl create -f myawesomeconfig.yml
kubectl delete my-not-so-awesome-deployment
exec into pod
ssh into pod to do terminal stuff like working with your interactive Python, PHP or node shells
kubectl exec -ti my-awesome-app-1234 bash
kubectl get sv
kubectl get services
kubectl logs my-awesome-app
decribe pods, get detailed information about the pods status
kubectl describe po my-awesome-app
Map is used when you want to modify data in some list or array and return a new modified array from that original array.
I’m really enjoying cryptocurrency and all the fanfare that comes with it, so let’s use an array of crypto prices in our code example.
- iterate through the array
- pull out all the prices which happen to be the second property of each currency object
- save these prices into a prices array