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
import java.util.Scanner; | |
import java.util.ArrayList; | |
public class Fibonacci { | |
public static ArrayList<Integer> series(int range) { | |
ArrayList<Integer> list = new ArrayList<>(); | |
list.add(0); | |
if (range == 1) | |
return list; |
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 a = 12, b = 24; | |
// destructuring assignment | |
[ a, b ] = [ b, a ]; | |
// addition and difference - 1 | |
a = a + b; | |
b = a - b; | |
a = a - b; |