python javascript commentaire def f() : function f() {} tab[début:fin] tab.slice(début,fin) string ou list tab[début:] tab.slice(début) tab[a] tab[a] = tab.slice(a,a+1)[0] tab.append( a ) tab.push( a ) len(tab) tab.length p = [] var p = new Array(q1, q2) """ texte sur plusieurs lignes """ ` texte sur plusieurs lignes ` chaine[i] chaine.charAt(i) i='' let i='' local variable var i=0 ; const i=0 ; for i in tab : for (i of tab) {} len(tab) tab.length range(10) Array(10).keys() True False true false if condition : if (condition) {} a or b a || b a and b a && b not a ! a try : try {} except : raise Exception catch (error) {} texte.split('/') texte.split('/') texte.strip() texte.trim() if element in liste : liste.index(element) liste.find(element) class Fraction : class Fraction { def __init__(self,n) : constructor(n) { self.n = n this.n=n; } def fonc(self) : fonc() { self.n*=2 this.n*=2 ; } obj = Fraction(n) var obj = new Fraction(n) ; x // y Math.floor(x/y) scope des variables la fonction si déclarée var/const le bloc si déclarée let global x global si pas déclarée localement par let/var/const math.sin(x) Math.sin(x) Math.pow() Math.log() float(x) parseFloat(x) max(x,y) Math.max(x,y) math.ceil(x) Math.ceil(x) Math.floor(x) Math.round(x) os.path.basename() var path = require('path'); path.basename(); document.getElementById("ident").value document.getElementById("ident").innerHTML document.getElementById("ident").title